Building an n-tier layered architecture

In n-tier architecture (also known as multitier architecture), you need to apply the principle of loosely coupled design (refer to Chapter 4, Principles of Solution Architecture Design) and attributes of scalability and elasticity (refer to Chapter 3, Attributes of the Solution Architecture). In multilayer architecture, you divide your product functions into multiple layers, such as presentation, business, database, and services, so that each layer can be implemented and scaled independently.

With multitier architecture, it is easy to adopt new technologies and make development more efficient. This layered architecture provides flexibility to add new features in each layer without disturbing features of other layers. In terms of security, you can keep each layer secure and isolated from others, so if one layer gets compromised, the other layers won't be impacted. Application troubleshooting and management also become manageable as you can quickly pinpoint where the issue is coming from and which part of the application needs to troubleshoot.

The most famous architecture in multilayer design is three-tier architecture, so let's learn more about it. The following diagram shows the most common architecture, where you interact with a web application from the browser and perform the required functions, for example, ordering your favorite T-shirt or reading a blog and leaving a comment:

Three-tier website architecture

In the preceding architecture, you have the following three layers:

  • Web Layer: The web layer is the user-facing part of the application. End users interact with the web layer to collect or provide information.
  • Application Layer: The application layer mostly contains business logic and acts upon information received from the web layer.
  • Database Layer: All kinds of user data and application data are stored in the database layer.

Let's take a look at these layers in more detail.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.181.81