It is always beneficial to develop any web application in a layered fashion. A prominent n-tier (or sometimes 3-tier) solution is the layered architecture, which has been widely adopted as the standard pattern for designing most applications. It is not a new concept, and we have been using it for a long time.
A layered architecture separates the whole application into various layers of concerns, which are logically different from each other:
- Presentation layer: This layer contains the artifacts that are responsible for building a user interface or displaying the output to the end user
- Application layer: This layer contains business logic and interacts with the presentation and persistence layers to makeup the flow of the application
- Persistence layer: This layer stores the data in data stores such as databases, the filesystem, and external sources...