Distributed Systems Fundamentals
Understand why teams distribute computation, what they gain, and which failure modes appear immediately.
2–5 minute refresher
Client→Service A→Service B→State
Independent machines + unreliable network + shared product promise
30second
refresher
refresher
A distributed system is a set of independent computers that cooperate to look like one product. Teams distribute work to scale capacity, place computation near users, isolate failures, and survive machine loss—but every network boundary introduces delay and uncertainty.
What problem does distribution solve?
One machine has finite CPU, memory, storage, and network capacity. It is also one fault domain. Distribution lets the system add capacity horizontally, replicate critical state, and continue when some components fail.
The core realities
- No shared clock: machines disagree about time.
- No instant global state: every observation may already be stale.
- Partial failure: one component can fail while the rest keep running.
- Finite coordination: stronger guarantees require communication, which costs latency and availability.
Decision guide
Key trade-offs
| Choice | What you gain | What it costs |
|---|---|---|
| Horizontal scale | More capacity and smaller fault domains | Partitioning, routing, and rebalancing |
| Replication | Availability and durability | Lag, conflicts, and coordination |
| Service boundaries | Independent ownership and deployment | Remote-call failure and operational complexity |
What happens if?
A request times out after updating state
The client does not know whether the write failed or only the response failed. Retrying without an idempotency key can duplicate the operation; refusing to retry can lose the user’s intent.
Where this appears
Cloud services, databases, queues, caches, search engines, and even a mobile application talking to an API are distributed systems. The relevant question is not whether a product is distributed, but where its failure and consistency boundaries are.
Fundamental interview modeWhat makes a distributed system harder than a multithreaded program?Show answer
Independent failure, message delay or loss, and the absence of shared memory or a perfectly shared clock mean no participant can know the complete current state.