Layered Architecture Pattern (n-Tier)

Layered Architecture Pattern (n-Tier)

A layered architecture pattern is one of the common software architecture patterns if it's not the common one.

Simply it's a philosophy of making your app as organized horizontal layers, and every layer performs a specific role.

As we mentioned before every layer is specialized in a specific role, for example:

  • Presentation Layer: Handles all user interface and browser communication logic.
  • Business Layer: Responsible for performing business rules against the data.
  • Persistence Layer: It's responsible for dealing with data, (store, fetch, update, delete).
  • Storage Layer: It's where we store our data (Database, files...etc).

Note: Each layer in the architecture is decoupled and forms an abstraction about its role, for example, the presentation layer should not worry about how the data is being processed in the deep layers, and the business layer should not worry about the data will be formatted to the user, why? this will make your software easy to develop, testable, and maintainable and this will reflected in the cost of your software.


Pattern Analysis

  • Testability: High, because each layer is responsible for a specific goal so when we want to test the components inside each layer, simply we can mock all other layers and test the goal layer. for example, we can mock the business layer to test the presentation layer.


  • Performance: Low, because every request should go to whole layers to be processed.


  • Scalability: Low, because it's expensive to scale, every time the traffic increases in your app you will need more servers to hold the whole app, but if you go with microservices architecture, you will need more servers only for limited services instead of the whole services as n-Tier architecture.


  • Ease of development: Easy, Because you will have like a form for your new feature, you will create a new controller to receive requests, create a new service to do business logic, and create a new repository to deal with your storage.


  • Ease of deployment: Low, because at every change in any layer you have to re-deploy your app that contains all layers.







Mohammad Al-Dwairi

Software Development Engineer II at Expedia Group

9 个月

Keep it up ??

Abdelrahman AlShakhshir

Software Development Engineer - Platform Solutions @ Expedia Group

9 个月

Very informative, thanks for sharing ????

Yazan Monshed ?

DevOps. GNU/Linux User. FOSS Contributor

9 个月

Congrats Maher keep going ????

要查看或添加评论,请登录

Maher Alzu’bi的更多文章

  • Software Architecture

    Software Architecture

    Software Architecture It's the way of ordering your system components to do their function in the best possible way…

    1 条评论

社区洞察

其他会员也浏览了