Case studies
How real companies built it
Short notes on engineering write-ups from real companies: what they built, and the lesson for you. Each card links to the original post.
56 case studies
- Airbnb
Avoiding double payments with an idempotency library
Airbnb built a shared idempotency library for payment services. It keeps database commits few, sorts errors into retryable and non-retryable, and lets failed requests heal through safe retries.
paymentsreliability - Amazon
How Dynamo kept the shopping cart always writable
Dynamo chose availability over strict consistency, using consistent hashing, sloppy quorums and vector clocks. The app merges conflicting versions, so a cart never loses an added item.
databasesreplication - Amazon
Shuffle sharding: shrink the blast radius of one bad customer
Give each customer a random mix of workers instead of one fixed shard. A bad customer then hurts only their own mix, and almost no other customer shares all the same workers.
reliabilityarchitecture - Amazon
Timeouts, retries and backoff with jitter done right
Set timeouts from real latency percentiles, retry at one layer only, and cap retries. Add backoff and jitter so clients do not retry in sync and overload a service that is already struggling.
reliability - Amazon
What ten years of running DynamoDB taught its builders
The DynamoDB paper shows how the team handled fairness, uneven traffic across partitions and automated operations. They kept latency predictable without giving up availability, even at 89 million requests per second.
databasesscaling - Amazon
Why queue backlogs can turn a short outage into a long one
A queue hides overload until the backlog takes hours to drain. Watch message age, add backpressure, move stale or noisy work aside, and plan for backlogs from day one.
messagingreliability - Anthropic
Contextual retrieval: add context to chunks before indexing
Before indexing, each chunk gets a short note explaining where it fits in its document. With BM25 and embeddings together, failed retrievals dropped by 49 percent, and by 67 percent with reranking.
aisearch - Cloudflare
Pingora: replacing NGINX with a proxy written in Rust
NGINX tied each request to one worker and kept connection pools per worker, which hurt reuse. Pingora shares pools across threads and uses a third of the CPU and memory.
performancenetworking - Discord
Fanning out messages to millions of users with Elixir
Sending one message to a huge server meant millions of process sends. Discord built Manifold to group sends by remote node, which spread the CPU cost and cut network traffic.
realtimescaling - Discord
Fast local SSD reads with network-disk durability
Discord mirrored local SSDs and network disks in a Linux RAID1 array, marking the network disk write-mostly. Reads come from the fast local disk while writes still reach durable storage.
performancestorage - Discord
Moving trillions of messages from Cassandra to ScyllaDB
Garbage-collection pauses and hot partitions made Cassandra painful to run. Discord moved to ScyllaDB and added Rust data services that merge identical reads, so one database query serves many users.
databasesmigrations - Discord
Why Discord rewrote a Go service in Rust
A Go service showed latency spikes every two minutes because Go forces a garbage collection run. The Rust version has no garbage collector, so the spikes went away.
performance - Dropbox
Rewriting the Dropbox sync engine safely
The old sync engine had a flawed data model that small fixes could not save. The rewrite used a clean data model, Rust, and seeded random simulation tests that replay any failure.
architecturetesting - Ensemble Studios
Age of Empires: thousands of units over a slow modem
Instead of sending unit positions, each player sends only commands and every machine runs the same simulation in lockstep. Any difference is detected as out of sync, which also blocks many cheats.
gamingrealtime - Figma
Horizontally sharding Postgres behind a query proxy
After splitting tables into separate databases, Figma sharded large tables horizontally. A proxy routes and runs sharded queries, and logical sharding came before the risky physical move.
databasessharding - Figma
How Figma's multiplayer editing works
Figma took ideas from CRDTs but kept a central server as the authority. That made the system simpler and faster than full CRDTs or operational transforms.
realtime - Google
Spanner: a global database built on known clock error
Spanner exposes clock uncertainty through its TrueTime API instead of hiding it. That lets it offer externally consistent transactions across the globe, plus lock-free read-only transactions.
databasesconsistency - Google
The Tail at Scale: rare slowness becomes common at scale
When one request fans out to many servers, a rare slow server slows most requests. Google argues you should build tail-tolerant systems, reusing fault-tolerance tricks to hide slow parts.
performancereliability - Google
Zanzibar: one consistent permission system for all of Google
Zanzibar stores access rules as relationships and serves hundreds of services from one model. It respects the order of user actions, so a check never uses permissions older than the content.
securityarchitecture - Instagram
Making sortable 64-bit IDs inside sharded Postgres
Each ID packs a timestamp, a logical shard number and a sequence, built by a Postgres function. IDs sort by time and need no central ID service.
databasessharding - LinkedIn
How Kafka reached 2 million writes a second on cheap machines
Kafka gets its speed from sequential disk I/O, the OS page cache and batching small records together. Throughput stayed steady as stored data grew, with mostly default settings.
messagingperformance - LinkedIn
The log: the simple idea under databases and streams
Jay Kreps shows that an append-only, ordered log sits under replication, data integration and stream processing. Treating the log as the source of truth makes many systems simpler to connect.
messagingarchitecture - LMAX
LMAX: 6 million orders a second on one thread
LMAX runs all business logic in memory on a single thread, using event sourcing for recovery. Lock-free ring buffers called Disruptors feed it, avoiding the cost of locks and queues.
performancearchitecture - Meta
Scaling memcache to billions of requests a second
Facebook turned memcached into a large distributed cache and coordinated it with the database. The paper shows how they traded strong consistency for speed, availability and simple operations.
cachingscaling - Meta
TAO: a graph cache in front of sharded MySQL
Facebook hid memcache and MySQL behind a small graph API of objects and links. Two cache tiers serve huge read volume, and the team chose eventual consistency over losing availability.
cachingdatabases - Netflix
Adaptive concurrency limits instead of hand-tuned limits
Fixed concurrency limits go stale as code and traffic change. Netflix measures latency and adjusts the limit automatically, like TCP congestion control, to reject extra work before queues explode.
reliabilityperformance - Netflix
Moving the Zuul gateway to async I/O: what it really gave
Netflix moved its gateway from blocking threads to async, non-blocking I/O. It did not gain much CPU efficiency, but connections became cheap, which enabled push and persistent connections.
performancearchitecture - Notion
Sharding Postgres by workspace at Notion
Notion sharded every table linked to a block, using workspace ID as the key. Most queries stay inside one workspace, so cross-shard joins are rare.
databasessharding - Notion
Tripling the database fleet with zero downtime
Notion grew from 32 to 96 Postgres machines while live. They copied data with logical replication, checked results, and moved traffic shard by shard through PgBouncer.
databasesmigrations - PhonePe
Moving 100 billion events a day into Kafka
Services write events to local disk through a client library, and a separate process ships them to Kafka. Teams get a simple API while the platform team runs the pipeline.
messagingscaling - PhonePe
TStore: one store for every payment's history
Every change is first written to a Kafka write-ahead log, then to HBase with indexes. Notifications go out only after both writes succeed, so readers never see unsaved changes.
paymentsdatabases - Pinterest
Sharding MySQL with IDs that say where data lives
Pinterest picked mature MySQL and pre-split data into thousands of shards. Each 64-bit ID holds its shard number, and data never moves between shards.
databasessharding - Riot Games
Making VALORANT servers 20 times faster for 128 tick
Riot needed each server frame under 2.34 ms but started at 50 ms. They split the cost by subsystem, gave each a budget, and tuned the OS scheduler to use the CPU better.
gamingperformance - Riot Games
Shrinking peeker's advantage in VALORANT's netcode
Peeker's advantage comes from adding up network delay, buffering, frame time and tick rate. Riot cut each piece, such as keeping the movement buffer small, to keep fights fair.
gamingrealtime - Shopify
Choosing a modular monolith over microservices
Shopify kept one codebase but split it into components with clear, checked boundaries. They judged that microservices would bring their own problems and that modularity fixed the real pain.
architecture - Shopify
Load testing the whole platform before Black Friday
Shopify scales its platform up to the expected peak, runs full load tests, studies the results and repeats. Doing this many times a year finds weak spots long before the real sale.
performanceecommerce - Shopify
Pods: splitting Shopify into isolated groups of shops
Shopify groups shops into pods, each with its own datastores, while sharing app servers. A routing layer sends each request to the right pod, so one pod's failure stays inside it.
architecturescaling - Shopify
Surviving flash sales with a checkout queue at the load balancer
Checkout writes were overloading the database during flash sales. Shopify added a leaky-bucket throttle in scriptable load balancers and sent extra buyers to a cached waiting page.
ecommercescaling - Shopify
Ten habits for building payment systems that hold up
Shopify lists the basics: short timeouts, circuit breakers, idempotency keys, capacity planning and reconciliation. Default HTTP timeouts are often far too long for a waiting customer.
paymentsreliability - Slack
Flannel: an edge cache so huge teams can start fast
Clients of very large teams downloaded too much data at startup. Flannel caches users and channels at the edge, serves them on demand, and pushes data the client will likely need next.
cachingperformance - Slack
How Slack delivers messages in real time
Stateful channel servers own channels through consistent hashing. Gateway servers in many regions hold user WebSocket connections and pass messages between clients and channel servers.
realtimearchitecture - Slack
Moving from per-workspace shards to Vitess
Sharding by workspace created hot shards for big customers and wasted the rest. Slack moved to Vitess, which let them shard by other keys like channel and spread the load.
databasessharding - Slack
Shared channels broke the one-workspace-per-shard rule
Slack's backend assumed every piece of data belonged to one workspace and one shard. Letting two companies share a channel forced a rethink of how data and routing are partitioned.
architecturesharding - Square
Books: an immutable double-entry accounting service
Square built one shared ledger service so product teams do not build their own. Entries are insert-only, and mistakes are fixed with a new correcting entry, which gives a full audit trail.
ledgerspayments - Stripe
Canonical log lines: one rich log line per request
At the end of each request, Stripe writes one line with the key facts: route, user, status, timing and query counts. Simple queries over these lines answer most questions during an incident.
observability - Stripe
Idempotency keys make API retries safe
The client sends a unique key with each operation, and the server remembers the result for that key. A retry after a network failure then never charges a customer twice.
paymentsapi - Stripe
Ledger: checking every money movement with double entry
Stripe records money flows as an immutable log of double-entry events. Balances that do not clear to zero point to real problems, and data-quality scores track how correct the system is.
ledgerspayments - Stripe
Online data migrations in four safe steps
Stripe dual-writes to old and new tables, moves reads, moves writes, then deletes the old data. Each step can be checked and reversed, so large migrations need no downtime.
migrationsdatabases - Stripe
Two rate limiters and two load shedders that protect an API
Stripe uses two rate limiters: one for requests per second and one for requests running at the same time. They run in Redis, and rate limiting uses the token bucket algorithm. Two load shedders also drop less important traffic when the whole system is busy. The post advises that limiters fail open, so a bug in them does not take the API down.
reliabilityapi - Swiggy
Turning a delivery monolith into a logistics platform
Swiggy's delivery monolith could not scale or support new businesses. They rebuilt it as a multi-tenant platform where a job is a chain of small tasks, which allowed multi-leg deliveries.
architecturemigrations - Uber
Moving a trillion ledger entries without downtime
Uber moved all its payment ledger data from DynamoDB to an immutable ledger store. Shadow validation compared old and new answers, with clear accuracy targets so the team did not chase every false alarm.
ledgersmigrations - Uber
Retry topics and dead-letter queues with Kafka
Failed messages go to a chain of retry topics, then to a dead-letter topic, so the main consumer keeps moving. Errors stay visible and can be replayed without blocking real-time traffic.
messagingreliability - Uber
Schemaless: an append-only datastore built on MySQL
Uber built a scalable store on plain MySQL where each cell is immutable and updates write a new version. Simple, well-known parts made it easier to operate than a newer database.
databasesscaling - vLLM
PagedAttention: paging GPU memory to serve LLMs faster
vLLM stores the attention key-value cache in small blocks, like virtual memory pages. Less wasted GPU memory means bigger batches and up to 24 times the throughput of a plain baseline.
aiperformance - Zerodha
Running billions of rows of reports on plain Postgres
Zerodha denormalises data, uses materialized views, and partitions tables by month. Plain Postgres handles heavy financial reporting when the schema fits the queries.
databases - Zerodha
Scaling a large broker with simple, boring choices
Zerodha prefers simple, well-known tools over fashionable ones. The database is almost always the bottleneck, so they serve reads from Redis and use ETags to save bandwidth.
scalingarchitecture