N-tier architecture
N-tier architecture divides an application into logical layers and physical tiers. where each layer is separated by its responsibilities for a 3-layer architecture for controller layer, service layer and Dao layers are all having its responsibilities.
Tiers refers to separating the machines, running webserver in a machine and application server in another machine and database server will on machine like this we can differentiate tiers, The purpose of dividing an application into tiers is to improve scalability, performance, and maintainability.
Types of N-Tier architecture
3-Tier architecture :
-> Presentation layer: It is application website users can interact.
-> Service Layer: data will come here from presentation layer for that data, it performs business operations and passes through the Dao layer.
-> Dao layer: this will connect to database based on the requirements from the service layer it performs operations.
2-Tier architecture:
-> the application interacts with user and the application will communicate with database, here service layer is not present.
1-Tier architecture:
-> All the layers are present in the one server all functionalities are present in one application
Advantages:
-> Increase the performance of the application like scalability, maintainability, Availability.
Disadvantages:
-> Network latency issues
-> Complexity