Key Concepts
Distributed systems are fundamentally different from local systems. The network is unreliable. Plan for it.
CAP Theorem
You can only guarantee 2 of 3: Consistency, Availability, Partition Tolerance. You must choose.
8 Fallacies of Distributed Computing
False assumptions developers make about distributed systems. By Peter Deutsch, Sun Microsystems.
Middleware
Software layer between distributed components — handles communication, transaction management, security.
Distributed Architectures
Client-server, multi-tier, peer-to-peer, service-oriented — different models for different needs.
Concept Deep Dives
Click each concept to expand — real examples, diagrams, pros & cons.
CAP Theorem
When to Use
Designing any distributed database or service — you must choose your trade-off.
Real-World Example
DynamoDB: AP (available + partition-tolerant). PostgreSQL: CP (consistent + partition-tolerant). No real CA system exists at scale.
✓ Advantages
- Forces explicit trade-off decisions
- Explains why distributed DBs differ
⚠ Watch Out
- Oversimplified — PACELC extends it
8 Fallacies of Distributed Computing
When to Use
Every time you design a distributed system — check against these.
Real-World Example
Every distributed systems outage is caused by someone violating one of these. The network is NOT reliable.
✓ Advantages
- Prevents architectural mistakes
- Exposes hidden assumptions
⚠ Watch Out
- Easy to forget under deadline pressure
Middleware
When to Use
Any distributed system with multiple services that need to communicate reliably.
Real-World Example
Kafka (message queue), gRPC (RPC framework), Redis (distributed cache), Consul (service discovery).
✓ Advantages
- Hides network complexity
- Standard communication patterns
- Enables loose coupling
⚠ Watch Out
- Another layer to fail
- Learning curve
- Cost and operational overhead
Distributed Architectures
When to Use
Choosing the right distributed model for your scale and requirements.
Real-World Example
Spotify: microservices. BitTorrent: P2P. AWS: multi-tier (UI tier → app tier → data tier).
✓ Advantages
- Match architecture to problem
- Well-understood patterns
⚠ Watch Out
- Wrong model = wrong trade-offs
Quick Reference
- 1Distributed systems: software that runs on multiple computers communicating over a network.
- 2CAP theorem: can only guarantee 2 of: Consistency, Availability, Partition Tolerance.
- 38 Fallacies: network is NOT reliable, zero-latency, infinite bandwidth, secure, homogeneous.
- 4Middleware: software layer handling communication, transactions, security between components.
- 5Client-server, multi-tier, P2P, service-oriented — different distributed architectures.
- 6Design for failure: network partitions WILL happen. Plan timeouts, retries, circuit breakers.
Quiz — Test Yourself
Think through your answer first, then reveal.