Suggest an editImprove this articleRefine the answer for “Give examples of typical layers in a web application”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)In a typical **web application**, the architecture is split into several layers, each playing its own role - from the user interface to the database. **Key point:** the typical structure of a web application looks like this: presentation layer -> business logic -> data layer, with API/integrations and infrastructure alongside; this separation makes the system understandable, modular, and easy to maintain.Shown above the full answer for quick recall.Answer (EN)ImageIn a typical **web application**, the architecture is split into several layers, each playing its own role - from the user interface to the database. Here is the structure and examples: --- ### **1. Presentation Layer** **Purpose:** interaction with the user. **What it does:** displays data and accepts input. **Examples:** - HTML, CSS, JavaScript - Frameworks: React, Vue, Angular - Controllers and routers (for example, in Express.js, Django Views, [ASP.NET](http://ASP.NET) Controllers) - Forms, buttons, pages, an API interface --- ### **2. Business Logic Layer** **Purpose:** implementing the rules and logic of the application. **What it does:** decides *what exactly* happens when the user acts. **Examples:** - Service classes, managers, handlers (Service, Manager, UseCase) - Modules that perform calculations, checks, validations - Frameworks: Spring Services, Django Models/Services, NestJS Services - Example functions: calculating a price, applying a discount, checking authorization --- ### **3. Data Access Layer** **Purpose:** access to the database. **What it does:** saves, retrieves, and updates data. **Examples:** - SQL queries, ORM models (Django ORM, SQLAlchemy, Hibernate) - Repositories and DAOs (Data Access Objects) - Connections to PostgreSQL, MySQL, MongoDB, and others --- ### **4. Infrastructure Layer** **Purpose:** keeps supporting systems running. **What it does:** manages external resources, logs, files, networks. **Examples:** - Configuration, API clients, queues (RabbitMQ, Kafka) - Notification services, caching (Redis), logging - Authentication and authorization (JWT, OAuth) --- ### **5. (Sometimes) API or Integrations Layer** **Purpose:** the link between the internal logic and external systems. **Examples:** - REST / GraphQL / gRPC controllers - API adapters for third-party services (payments, email, geolocation) --- **Summary:** The typical structure of a web application looks like this: ```javascript [Presentation Layer] → [Business Logic] → [Data Layer] ↑ ↓ [API / Integrations] [Infrastructure] ``` This separation makes the system understandable, modular, and easy to maintain.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.