Case Study Patterns
What kept coming back.
We've designed a shortener, a rate limiter, chat, a feed, notifications, video, a crawler, ride matching, autocomplete, and a key value store. The same few ideas appeared again and again.

- Ten designs
- The same ideas
- Again and again
Patterns and where they appeared
Caching appeared almost everywhere, for redirects, feeds, and suggestions. Queues decoupled slow work, in notifications, video, and feeds. Sharding by a good key handled size. Object storage and CDNs carried big files. And precomputing, doing work ahead of time, made reads instant in feeds and autocomplete.
| Pattern | Appeared in |
|---|---|
| Caching | shortener, feed, autocomplete |
| Queues | notifications, video, feed |
| Sharding | chat, key-value store |
| Object storage + CDN | video, crawler |
| Precompute | feed, autocomplete |
Questions that unlock designs
Four questions unlock most designs. Is it read heavy or write heavy? What can be done ahead of time? What can be done later, asynchronously? And what's the right key to split the data by? Ask these, and the shape of a design usually appears.
Summary
A small set of patterns, caching, queues, sharding, storage and CDNs, and precomputing, solves most design problems. Next, a quiz on the case studies.
Key takeaways- Cache, queue, shard
- Precompute
- Ask four questions