## Three-Tier Architecture Three-Tier Architecture divides an application into three logical layers: 1. **Presentation Layer (User Interface / Front-end):** This is the layer with which the user interacts. It presents the application's data and functionality in a user-friendly format. 2. **Business Logic Layer (Application / Back-end):** This is where the application's functionality is implemented. It controls the application's functionality by performing detailed processing. 3. **Data Layer (Database / Back-end):** This is where the data is stored and retrieved. It includes the data persistence mechanisms (database servers, file shares, etc.) and the data access layer that encapsulates the persistence mechanisms and exposes the data. ![](https://storage.googleapis.com/memvp-25499.appspot.com/images/image.png477a4710-bc41-41d0-a90c-8c78c7dbc5cb) Each layer resides on separate servers or processes, which helps in organizing code for scalability, maintainability, and performance. Compared to alternatives like MVC or Microservices, three-tier offers a balanced approach between code separation and complexity; while MVC mingles UI and business logic, Microservices could introduce operational complexity. [[Django]] naturally follows this architecture with its MTV (Model, Template, View) structure, whereas [[React.js]], a JavaScript library, deals predominantly with the presentation layer. The front-end and back-end of a web application communicate with each other using [[HTTP requests]] and [[HTTP Methods]], often in the form of [[RESTful APIs]] or [[GraphQL]]. This communication is language-agnostic, meaning it doesn't matter what language the front-end or back-end is written in. The front-end sends a request to specific [[API endpoints]] on the back-end, and the back-end sends back responses. These responses are often in the form of JSON, which can be easily handled by any front-end framework. So, you can use any front-end framework with a Python back-end. The key is to design your back-end API in a way that's easy for the front-end to use, and to handle any data transformation that might be necessary on the back-end. **Back-end = API 🤯**