A distributed system uses multiple machines that communicate over a network to deliver a service. For a frontend engineer, the consequences can appear as API behavior, slow requests, inconsistent data, or failures that affect only part of an application. Understanding those consequences helps with end-to-end design and conversations with backend teams. section 6.0 section 6.6
Deployment matters more than the number of layers in an architecture diagram. An n-tier application is distributed when its tiers run on separate machines and communicate over a network; separate layers alone do not make it distributed. Microservices are inherently distributed, but their independent deployment and scaling come with orchestration and monitoring costs. section 6.1
Table 6.2 Architectural models compared
|
Architecture
|
Pros
|
Cons
|
Use cases
|
|
Monolithic
|
Simple to build, test, and deploy. Fewer moving parts.
|
Hard to scale, maintain, or modernize as app complexity grows.
|
MVPs, early-stage products, internal tools.
|
|
3-Tier
|
Clear separation of concerns (UI, logic, data). Enables modular design.
|
Limited flexibility with cross-cutting concerns like auth and logging.
|
Traditional web apps with REST or GraphQL APIs.
|
|
N-ter
|
Better scalability and specialization. Supports cross-cutting concerns.
|
Increased complexity and potential latency between layers.
|
Enterprise systems, regulated or mission-critical apps.
|
|
Microservices
|
Team autonomy, independent deployment, horizontal scaling.
|
Requires orchestration, monitoring, and distributed system expertise.
|
Large SaaS platforms, high-scale distributed systems.
|
Compare the scalability and complexity trade-offs of monolithic, tiered, and microservices architectures. section 6.1
In a design interview, connect each choice to a requirement or failure scenario:
- During a network partition, explain the trade-off between returning a response and guaranteeing that a read reflects the latest write. Choose a consistency model according to the application’s needs. section 6.2
- For growing traffic, contrast adding resources to one machine with adding instances. Horizontal scaling improves elasticity and fault tolerance but requires load balancing and attention to state. section 6.3
- For reliability, explain how nodes communicate, how replication affects write latency and consistency, and how metrics, logs, traces, and health checks expose failures. section 6.6
A frontend-to-API boundary
Suppose a UI and its API run on different origins. The browser’s same-origin policy prevents frontend JavaScript from reading the API response unless the backend permits it with CORS headers. A good answer identifies which service sets those headers and checks how credentialed requests are handled, rather than treating the problem as a React-only bug. section 6.1
The useful takeaway is not that every service should be distributed. Be ready to say where the network boundary lies, which scaling or consistency guarantee matters, and how the system will reveal and handle failures. section 6.1 section 6.2 section 6.6


















