Real-World Case Studies
Theory is essential, but seeing how distributed systems work (and fail) in production at massive scale is where deep understanding comes from. This module covers battle-tested architectures from the world’s leading technology companies. Every case study in this chapter follows the same pattern: a company hit a scaling wall, made a set of engineering trade-offs under real constraints (time, money, team expertise, existing code), and lived with the consequences — both intended and unintended. These are not “the right way” to build systems; they are “one way that worked for a specific company at a specific point in time.” The lesson is never “copy Google’s architecture.” It is “understand the reasoning that led to Google’s decisions and apply that reasoning to your own, very different, situation.”Track Duration: 12-16 hours
Companies Covered: Google, Amazon, Netflix, Uber, Meta, Stripe
Focus: Architecture decisions, failure stories, lessons learned
Companies Covered: Google, Amazon, Netflix, Uber, Meta, Stripe
Focus: Architecture decisions, failure stories, lessons learned
Google Spanner
The database that made the impossible possible — globally consistent transactions. Before Spanner, the conventional wisdom (hardened by the CAP theorem) was that you had to choose between strong consistency and global distribution. Spanner essentially said “what if we throw GPS satellites and atomic clocks at the problem?” and built a system where the laws of physics help enforce transaction ordering.Architecture Overview
Key Innovations
TrueTime: Making Time Trustworthy
TrueTime: Making Time Trustworthy
The Insight: You can’t synchronize clocks perfectly, but you can bound the uncertainty.Usage in Transactions:
Paxos Groups for Replication
Paxos Groups for Replication
Per-Tablet Paxos:
- Each tablet (partition) has its own Paxos group
- 3-5 replicas across zones
- Writes go through Paxos leader
- Reads can go to any replica (with proper timestamp)
- Tablets automatically split when too large
- Tablets merge when too small
- Paxos ensures consistent split/merge
External Consistency
External Consistency
The Guarantee: If transaction T1 commits before T2 starts, T1’s timestamp < T2’s timestamp.Why It Matters:Cost: Commit wait adds latency (~7ms average)
Spanner Failure Story: The Leap Second
Amazon DynamoDB
The database that powers amazon.com checkout—when availability is everything.Architecture Overview
Key Design Decisions
Always Available: The Shopping Cart Story
Always Available: The Shopping Cart Story
The Origin Story (from the 2007 Dynamo paper):Implementation:
- Leaderless replication
- Write to W of N replicas (W < N means some can be down)
- Read from R replicas, resolve conflicts
- Shopping cart uses “union” merge (keep all items)
Consistent Hashing with Virtual Nodes
Consistent Hashing with Virtual Nodes
Problem: Nodes joining/leaving causes massive data reshufflingSolution: Virtual nodes
Adaptive Capacity
Adaptive Capacity
Original Problem:
- Provisioned throughput (e.g., 1000 WCU)
- Uniform distribution assumed
- Hot partition = throttling
DynamoDB Failure Story: The 2015 US-EAST-1 Outage
Netflix: The Chaos Engineering Pioneers
Netflix serves 230+ million subscribers with 99.99% availability. How?Architecture Overview
Key Patterns
EVCache: Caching at Scale
EVCache: Caching at Scale
Scale:
- 30+ million requests/second
- 1+ trillion operations/day
- Petabytes of cached data
Zuul: Edge Gateway
Zuul: Edge Gateway
Responsibilities:
- Authentication
- Dynamic routing
- Load shedding
- Request throttling
- Attack detection
- Moved from thread-per-request to event loop
- 90% reduction in connection memory
- Better tail latency under load
Chaos Engineering: The Simian Army
Chaos Engineering: The Simian Army
Chaos Monkey (2011): Randomly kills instances in productionPhilosophy:
Netflix Failure Story: The 2012 Christmas Eve Outage
Uber: Real-Time at Scale
Uber processes millions of trips daily with sub-second dispatch decisions.Architecture Evolution
Key Systems
Ringpop: Consistent Hashing for Dispatch
Ringpop: Consistent Hashing for Dispatch
Problem: Matching riders to drivers needs consistent, fast routingSolution: Ringpop (swim + consistent hashing)
Schemaless: MySQL at Scale
Schemaless: MySQL at Scale
Challenge:
- Need horizontal scaling (MySQL doesn’t shard easily)
- Need flexible schema (trip data evolves fast)
- Need low latency (real-time dispatch)
Cadence: Workflow Orchestration
Cadence: Workflow Orchestration
Uber’s solution for long-running, fault-tolerant workflows.Open Source: Temporal (Cadence fork) now widely adopted
Uber Failure Story: The 2019 Mapping Outage
Stripe: Financial Transactions at Scale
When money is involved, correctness is everything.Architecture Principles
Key Patterns
Idempotency Keys
Idempotency Keys
How it works:TTL: Idempotency keys typically expire after 24 hours
Transactional Outbox Pattern
Transactional Outbox Pattern
Problem: Need to update database AND send event atomically
Request Hedging
Request Hedging
Problem: Tail latency (p99) is often much worse than medianSolution: Send to multiple replicas, use first response
Common Patterns Across Companies
Idempotency Everywhere
All companies: Every mutating operation accepts an idempotency key.
Stripe:
Idempotency-Key header
AWS: ClientRequestToken
Google: requestIdChaos Testing
You don’t know if you’re resilient until you test.
Netflix: Chaos Monkey, Chaos Kong
Amazon: GameDay exercises
Google: DiRT (Disaster Recovery Testing)
Circuit Breakers
Fail fast instead of cascading.
Netflix: Hystrix (now Resilience4j)
Uber: Custom circuit breakers in every service
All use some variant of the pattern.
Observability
You can’t fix what you can’t see.
Distributed tracing: Zipkin/Jaeger-style
Metrics: RED method (Rate, Errors, Duration)
Logs: Structured, correlated by trace ID
Key Takeaways
- Availability often trumps consistency — Amazon’s shopping cart chose availability. Know when this trade-off is acceptable.
- Test failure modes in production — Netflix’s Chaos Engineering isn’t optional, it’s essential.
- Build for horizontal scale from day one — Re-architecting a monolith is painful. Design for distribution early.
- Invest in your primitives — Google built TrueTime. Uber built Ringpop. Your foundations matter.
- Every outage is a learning opportunity — The companies with the best uptime have the best postmortems.