Distributed Systems & The CAP Theorem
Understand distributed system fallacies, network partitions, PACELC theorem, ACID vs BASE, and why strong consistency limits scale.
A monolithic application runs inside a single operating system process. When Module A calls Module B, memory pointers are shared, execution is predictable, and if the process crashes, the entire system stops cleanly.
A distributed system is fundamentally different: it consists of autonomous computer nodes connected by an unreliable network that coordinate actions strictly by passing messages.
As legendary computer scientist Leslie Lamport famously observed:
"A distributed system is one in which the failure of a computer you didn't even know existed can render your own computer unusable."
01The 8 Fallacies of Distributed Computing
Engineers moving from monoliths to microservices frequently write fragile software because they unconsciously assume the network behaves like local RAM. In 1994, L. Peter Deutsch and James Gosling documented the 8 Fallacies of Distributed Computing:
- The network is reliable: Switches fail, cables get severed, cloud zones experience fiber cuts.
- Latency is zero: Local RAM lookup takes nanoseconds; cross-region network hops take 50 to 150 milliseconds.
- Bandwidth is infinite: Saturating gigabit uplinks with bloated JSON payloads throttles performance.
- The network is secure: Unencrypted internal VPC packets can be captured and spoofed.
- Topology does not change: Pods and containers restart, re-IP, and migrate across nodes dynamically.
- There is one administrator: Different teams manage security policies, firewall rules, and cluster routing.
- Transport cost is zero: Serializing, encrypting, routing, and deserializing HTTP payloads costs significant CPU.
- The network is homogeneous: Services run across varied hardware, operating systems, and network interface cards.
Loading the rest of the lesson…