Chapter 2. Web Application Architecture

So you’re ready to start coding. Crack open a text editor and follow along. . . .

Actually, hold on for a moment. Before we even get near a terminal, we’re going to want to think about the general architecture of our application and do a fair bit of planning. So put away your PowerBook, find a big whiteboard and some markers, order some pizza, and get your engineers together.

In this chapter, we’ll look at some general software design principles for web applications and how they apply to real world problems. We’ll also take a look at the design, planning, and management of hardware platforms for web applications and the role they play in the design and development of software. By the end of this chapter, we should be ready to start getting our environment together and writing some code. But before we get ahead of ourselves, let me tell you a story. . . .

Layered Software Architecture

A good web application should look like a trifle, shown in Figure 2-1.

A well-layered trifle (photo by minky sue: )
Figure 2-1. A well-layered trifle (photo by minky sue: http://flickr.com/photos/kukeit/8295137)

Bear with me here, because it gets worse before it gets better. It’s important to note that I mean English trifle and not Canadian—there is only one layer of each kind. This will become clear shortly. If you have no idea what trifle is, then this will still make sense—just remember it’s a dessert with layers. ...

Get Building Scalable Web Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.