Web Applications

This chapter is a continuation of the application layer, focusing on web applications from a computer networks perspective.

As we saw in the last chapter, browsers are complicated programs. Major browsers like Chrome, Firefox, and Safari take thousands of person-years to create, and it's impossible for a single person to understand every nook and cranny of the underlying source code in great detail. As such, many network application developers treat the browser as a black box, much like how other developers treat the operating system as a black box. We will largely do the same in this chapter, but raise browser-related issues as needed. This chapter's overarching focus is on web applications as they relate to networking: What approaches do we have available in designing web applications? What are the tradeoffs we face? What solutions do we have at our disposal? What are the edge cases? These are the kinds of questions we consider.

Types of Web Applications

Web applications can be categorized into four types:

  1. single-tier applications,
  2. two-tier applications,
  3. three-tier applications, and
  4. n-tier applications.

Merriam-Webster defines the word "tier" as "a row, rank, or layer of articles." We've been talking about layers at length — the application layer, the data link layer, the physical layer, etc. Well, as it turns out, applications in the application layer also consist of layers. Thus, the types above denote the number of layers an application uses to provide its services.

Single-tier Applications

A single-tier application is an application with just a single layer — the user's machine. The user interface, logic, and database all exist in one place. Most desktop applications are single-tier applications: Gimp, Inkscape, Photoshop, Terminal, Notepad, etc.

benefits
costs
  • Zero network latency.
  • Often faster and better performance than other architectures.
  • Smaller dependency graph.
  • Easiest architecture to maintain/debug.
  • Maximum security.
  • Performance is limited to machine performance.
  • Manufacturer loses all control of the application once it's shipped.
  • Application updates require user consent.
  • Requires large budget allocations for testing.
  • Harder to achieve uniformity: Machine-dependent.