liveBook · Manning

N-tier architecture

As explained in Acing the Frontend Interview

N-tier architecture extends layered application structure with multiple specialized tiers that may run on separate infrastructure.

A multi-tier application, also called N-tier architecture, extends the three-tier model by separating an application into multiple specialized tiers. Typical tiers include presentation, business logic, data, CDN, caching, and authentication. Tiers may be logical boundaries within one deployment or separate infrastructure communicating over a network. section 6.1

In an interview, explain why each tier exists rather than listing components. Additional tiers improve specialization, modularity, scalability, and maintainability, but add operational complexity and possible latency between layers. A multi-tier system becomes a distributed system when its tiers run on different machines or servers. section 6.0 section 6.1

Evaluate a proposed design by discussing:

  • Separation of concerns: keep presentation, application logic, data access, and cross-cutting services independently understandable. section 6.1
  • Scaling: consider specialized strategies such as CDN delivery or backend caching instead of scaling every tier identically. section 6.1
  • Communication: account for network boundaries, latency, authentication, and CORS when frontend and backend tiers are separate. section 6.1

Handling a separate frontend tier

A React frontend can call a backend API from another origin when the backend permits the frontend origin, methods, headers, credentials, and OPTIONS preflight requests through CORS response headers. During development, a Vite proxy can instead forward an /apiproxy path to the external API and rewrite the path.

Table 6.1 Architectural paradigms
Topic
Fundamentals
Applied skills
Advanced
Monolithic architectures
Understand single-deployable unit with tightly coupled components. Know pros: simplicity, ease of testing.
Break down feature modules using a Model-View-Controller (MVC)–style layered structure (controllers, services, database). Refactor legacy code safely.
Design strategies for modularity (e.g., using Hexagonal or Onion Architecture).
Plan gradual extraction to services.
3-tier architectures
Know layers: Presentation (UI), Application (logic), Data (DB).
Understand separation of concerns.
Connect frontend to backend via REST/GraphQL. Build APIs that link DB and UI layers.
Analyze scaling strategies per tier (e.g., CDN for frontend, caching for backend). Secure each tier independently.
N-tier Architectures
Understand how multiple layers (UI, CDN, caching, or authentication, Business Logic, DB) improve modularity and scalability.
Implement separation of concerns through middle tiers. Add services (e.g., auth, caching).
Optimize inter-tier communication, reduce latency, and apply security/logging consistently.
Microservices
Understand service decomposition, bounded context, and inter-service communication (REST, events). See chapter 7 for details.
Design, build, and deploy multiple small services. Implement discovery, retries, and health checks.
Handle distributed data consistency (e.g., saga pattern). Optimize service orchestration and observability.

Compare N-tier architecture with monolithic, three-tier, and microservices designs across fundamentals, applied skills, and advanced design concerns. section 6.1

How Acing the Frontend Interview covers it

How deep it goes
Explains tier boundaries, trade-offs, deployment conditions, and CORS concerns, but stops short of detailed distributed-systems internals.
Examples
Uses presentation, business-logic, data, CDN, caching, and authentication tiers plus Express CORS and Vite proxy configurations.
What it assumes
Assumes frontend fundamentals while building awareness of APIs, backend tiers, distributed systems, and system-level design.
What you can do after
Evaluate architectural choices and explain scaling, separation, network boundaries, CORS, and operational trade-offs in interviews.
How it connects
Connects N-tier architecture to layered architecture, three-tier architecture, microservices, caching, scaling, and CORS.

Also explained in

Compare how 8 books explain n-tier architecture →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the Frontend Interview. The section links point to the parts of the book it draws on.