Information Technology Reference
In-Depth Information
Chapter 4. Application Architectures
Patterns are solutions to recurring problems in a context.
—Christopher Alexander
This chapter examines the building blocks used when designing applications and other ser-
vices.Thepreviouschapterdiscussedcloudplatformoptions.Nowwemoveuponelayerto
the application architecture.
We start with an examination of common web service architectures beginning with a
single web server, to multi-machine designs, growing larger and larger until we have a
design that is appropriate for a large global service. Then we examine architectures that are
common behind the scenes of web applications: message buses and service-oriented archi-
tectures.
Most examples in this chapter will assume that the service is a web-based application us-
ing the Hyper-Text Transfer Protocol (HTTP). The user runsa web browser such as Firefox,
Chrome, or Internet Explorer. In HTTP terminology, this is called the client. Each request
for a web page involves speaking the HTTP protocol to a web server, usually running on
a machine elsewhere on the internet. The web server speaks the server side of the HTTP
protocol, receives the HTTP connection, parses the request, and processes it to generate the
reply. The reply is an HTML page or other file that is sent to the client. The client then dis-
plays the web page or file to the user. Generally each HTTP request, or query , is a separate
TCP/IPconnection,althoughthereareextensionstotheprotocolthatletonesessionprocess
many HTTP requests.
Some applications use protocols other than HTTP. For example, they may implement
their own protocol. Some non-web applications use HTTP. For example, mobile phone apps
may use HTTP to talk to APIs to make requests or gather information. While most of our
examples will assume web browsers speaking the HTTP protocol, the principles apply to
any client/server application and protocol.
4.1 Single-Machine Web Server
The first design pattern we examine is a single self-sufficient machine used to provide web
service ( Figure 4.1 ) . The machine runs software that speaks the HTTP protocol, receiving
requests, processing them, generating a result, and sending the reply. Many typical small
web sites and web-based applications use this architecture.
Search WWH ::




Custom Search