Architecture Case Studies
15 studiesReal-world architecture decisions documented from public engineering sources: what broke, why it was changed, and what was learned.
Cloudflare Workers KV committed explicitly to eventual consistency across 200+ edge locations to achieve sub-millisecond reads globally, acknowledging that globally consistent KV at acceptable latency is physically impossible and documenting the consistency model prominently rather than hiding it.
Discord migrated from MongoDB to Cassandra to ScyllaDB, driven by the fundamental mismatch between MongoDB's RAM-indexed storage and the channel+time range-scan pattern required for message history.
GitHub scaled MySQL by investing in tooling, building gh-ost for zero-downtime schema changes and adopting Orchestrator (created at Outbrain) for automated HA, rather than migrating away from a technology the team understood deeply.
Instagram built a logical sharding layer on PostgreSQL to scale from a single database to thousands of logical shards mapped across physical servers, routing by user ID without cross-shard joins: allowing server additions to be live migrations of logical shards rather than full resharding events.
LinkedIn built Kafka to replace direct synchronous writes from application services to multiple downstream systems, decoupling producers from consumers through a durable event log and enabling their search index, analytics warehouse, and recommendation engine to consume the same stream independently.
Netflix stores per-user viewing history in Cassandra partitioned by user_id, accepting eventual consistency because a few seconds of stale progress data is operationally acceptable while write availability across regions is not negotiable.
Notion sharded its multi-billion-row blocks table by workspace across 32 separate Postgres databases (application-level sharding, not native partitioning) after autovacuum could no longer keep up with the growth rate of a single monolithic table.
Pinterest manually sharded MySQL by embedding shard location directly into 64-bit primary keys, eliminating the need for a shard routing table: which itself would become a single point of failure: and creating one of the earliest and most widely cited MySQL sharding case studies in the industry.
Shopify migrated from single-primary MySQL to Vitess-sharded pods to isolate high-traffic merchants from shared database contention, proving on the 2019 Black Friday / Cyber Monday peak that pod-level tenant isolation prevents a single viral merchant from degrading the entire platform.
Slack replaced polling-based presence with WebSocket-driven push notifications backed by Redis heartbeats, enforcing explicitly lower durability requirements for ephemeral presence state than for durable message records: because losing a heartbeat is acceptable, losing a message is not.
Stack Overflow serves 1.5 billion page views per month with 9 web servers and 4 SQL Server instances by aggressively optimizing a monolith rather than distributing it, demonstrating that horizontal scaling adds operational complexity that is only justified when vertical optimization has been genuinely exhausted.
Twitter's timeline system collapsed under pure fan-out-on-write at celebrity follower counts, forcing a hybrid model where high-follower accounts are merged at read time into precomputed follower timelines: trading read-path complexity for write-path tractability.
Uber replaced relational databases for real-time driver geospatial state with a purpose-built geospatial indexing system using Google S2 cell hierarchies, reducing proximity query latency from seconds to sub-100ms across millions of concurrent active driver locations.
Uber migrated its core trip and driver data from PostgreSQL to MySQL in 2016 after discovering that PostgreSQL's MVCC model and WAL-based replication produced unsustainable write amplification at the scale of hundreds of millions of trips: every index update required a full tuple write to the WAL, not just the changed columns.
Zoom abandoned peer-to-peer video delivery early and built centralized SFU media servers with regional routing, trading server-side CPU cost for the upload bandwidth tractability that made multi-participant video calls reliable at global scale.