Understand Architecture
Understand how different parts of a web application work together.
Learn how real web applications are organized into presentation, application and data layers, and how APIs, authentication, caches, CDNs, reverse proxies and load balancers fit into a complete architecture.
Build a complete mental model of a production-style web application.
Understand how different parts of a web application work together.
Understand Model, View and Controller responsibilities.
See how frontend and backend components communicate.
Identify where authentication and authorization checks belong.
Learn where caching, CDNs and load balancing can fit into an architecture.
See why larger applications use multiple servers and layers.
Architecture describes how the major parts of an application are organized and communicate.
A web application may contain a browser-based user interface, backend application logic, databases, authentication services, APIs and supporting infrastructure.
Web application architecture describes how these parts are separated, how they communicate and what responsibilities each part has.
The goal is not simply to add more servers. Good architecture separates responsibilities in ways that make an application easier to build, operate, secure and change.
Web application architecture is the structure and communication design of the components that make a web application work.
Start with the smallest useful architecture.
One of the most important architecture models for Web Technologies.
Responsible for the user-facing interface and interaction.
Processes requests, applies business rules and coordinates application operations.
Manages persistent application data and database operations.
Separation of responsibilities makes systems easier to reason about.
Different parts of the system focus on different responsibilities.
DESIGNChanges in one layer can often be made without rewriting unrelated layers.
MAINTAINIndividual responsibilities can be tested more independently.
TESTINGDifferent layers can sometimes be scaled independently.
SCALEMVC is a common way to organize application code by responsibility.
A simplified example of a student-result request.
Architecture can range from a single deployable application to separately organized services.
Multiple application responsibilities can exist within one deployable application.
Application responsibilities are organized into clearer layers.
APIs provide a defined way for software components to communicate.
An API can serve as a clear boundary between software components. For example, a frontend can request student data from an API without directly connecting to the database.
A browser should normally communicate with a controlled application or service interface rather than receiving direct database credentials.
Security checks belong inside the application flow, not only inside the user interface.
Caches can reduce repeated work and improve response efficiency.
A cache stores eligible information so that a future request may be served without repeating all of the original processing.
Depending on the system, caching may exist in a browser, proxy, reverse proxy or managed CDN cache.
A CDN can place cached content closer to users.
A CDN is a distributed network of servers that can serve cached content from locations closer to users. This can reduce network distance for suitable content.
Multiple application instances can share incoming traffic.
It can distribute requests among multiple servers, allowing an application to use more than one backend instance.
Now combine the components we have learned.
Trace a request from a user to the application and data layer.
A user opens a web application and performs an action.
Requests can pass through multiple infrastructure layers before application processing.
Authentication and authorization are application security concerns, not merely interface features.
The database is part of the backend architecture, not a direct browser-facing service.
Select an architecture pattern and observe how the components are arranged.
Each additional layer should solve a real requirement.
| Component | Why It May Be Used | Typical Responsibility |
|---|---|---|
| API | Separate client and service communication | Interface between systems |
| Reverse Proxy | Front-door control and routing | Forward requests to backend systems |
| Load Balancer | Distribute traffic among instances | Traffic distribution |
| Cache | Avoid repeated work | Store eligible data/responses |
| CDN | Deliver suitable cached content closer to users | Distributed edge delivery |
| Database | Persistent application data | Store and retrieve data |
Apply the architecture to a familiar application.
A student signs in and asks the application to display the semester results.
The browser sends a secure request to the application. The backend checks authentication and authorization, processes the request and retrieves the required data.
The result is returned through the appropriate application interface and displayed by the browser.
These mistakes are frequently seen in beginner projects.
Normal web applications should place controlled application logic between the client and database.
Client-side checks can improve user experience, but protected resources require server-side enforcement.
More components do not automatically create better architecture.
When every component does everything, the system becomes harder to maintain and debug.
Think first, then click a card to reveal the answer.
Think about presentation, application and data.
It separates an application into presentation, application/business and data responsibilities. The exact implementation can vary.
Think Model, View and Controller.
MVC is a software architecture pattern that separates application state/data, presentation and request or input coordination into different responsibilities.
Think about credentials, validation and application logic.
A controlled backend layer can enforce validation, authentication, authorization and business rules, while keeping database credentials and database operations away from the browser.
Think about the server-side front door.
A reverse proxy receives client requests and forwards them to internal servers. Depending on its configuration, it can also support caching, routing, authentication or load balancing.
Think about distributing requests across servers.
A load balancer distributes incoming traffic across multiple backend instances according to configured routing and health mechanisms.
Think: identity versus permission.
Authentication verifies an entity's identity. Authorization determines what that authenticated entity is permitted to access or do.
Think about repeated work and response efficiency.
Caching allows eligible data or responses to be reused, which can reduce repeated processing, network traffic or latency.
Think about geographically distributed cached content.
A Content Delivery Network uses distributed edge locations to serve suitable cached content closer to users, which can reduce network distance and improve delivery performance.
Check your architecture knowledge.
Draw and explain the architectures yourself.
Draw a three-tier architecture for a college student portal.
Explain MVC using a student result application.
Explain why a browser should normally not receive database credentials.
Draw an architecture containing a reverse proxy, load balancer and three application servers.
Explain where authentication and authorization checks fit into an application.
Explain how a CDN and cache can reduce repeated work for suitable content.
Click a term to flip the card and reveal its meaning.
The structure and communication design of the components that make an application work.
Separation into presentation, application and data responsibilities.
Model-View-Controller, a pattern that separates application data/state, presentation and coordination.
A defined interface through which software components can communicate.
An intermediary server that receives client requests and forwards them to backend servers.
A component that distributes incoming traffic among multiple backend instances.
Content Delivery Network: distributed infrastructure that can serve suitable cached content from edge locations.
A storage layer that can retain eligible information for reuse on later requests.
Remember the architecture relationships.
User interface
Business logic
Persistent storage
Code organization pattern
Communication boundary
Traffic distribution
Reuse eligible data
Distributed edge delivery
A web application is a collection of cooperating components rather than simply an HTML page and a server.
Three-tier architecture separates presentation, application and data responsibilities. MVC provides another useful way of organizing application code.
APIs, authentication, reverse proxies, load balancers, caches and CDNs can be introduced when the application's communication, security, performance and scalability requirements justify them.
In the next level, we move from architecture into the professional tools and workflow used to build, inspect, debug and manage Web projects.
Finish the lesson and mark this topic as completed.