In software DDD engineering, a layered (multilayer, layered, N-tier) architecture is a client-server architecture that separates data presentation, processing, and storage functions. This architectural pattern mitigates the increasing complexity of applications and makes it easier and more flexible to rework them.
This architecture consists of different layers, each corresponding to a different function. Thus, making changes to each individual tier is easier than dealing with the entire architecture. Developers can create flexible and reusable applications. This greatly simplifies the entire system management process.
The Layers architectural pattern helps to structure applications into groups of subtasks at specific abstraction levels.
The most common variant is a three-tier architecture. A three-tier architecture usually consists of a presentation tier, a business logic tier, and a data storage tier.
[]()
Traditional variant of multilayer architecture
The three main layers of a layered architecture:
- **Presentation layer. **This is the first and topmost layer that is present in an application. This layer represents the [UI](), that is, the presentation of content to the end user through a graphical interface. This layer can be accessed through any type of client device such as desktop, laptop, tablet, cell phone, thin client, etc. For content displayed to the user, the relevant web pages must be retrieved by a web browser or other presentation component running on the client device.
- **Application Layer. **The service layer or management layer. This layer is also where the business logic of the application works. Business logic is the set of rules needed to run the application according to the guidelines set by the organization. The components of this layer usually run on one or more application servers. Sometimes the business logic is separated into a separate layer.
- **Data Layer.** This is the core of the architecture. This layer is mainly concerned with storing and retrieving application data. Application data is usually stored on a database server, file server, or any other device or media that supports data access logic. This is done at the data layer by providing an API for the application layer. Providing this API provides complete transparency into the data operations that are performed at this tier without affecting the application tier. For example, system updates at this layer do not affect the application layer of this architecture.
These three layers are important. But other layers can be built on top of them depending on the complexity of the system.
The layered approach is especially good for developing enterprise web applications and cloud systems. It also makes it easier to upgrade any legacy systems - when an architecture is broken down into multiple layers, the changes that need to be made will be simpler and less extensive than they might otherwise be.