AI Hints
Home›System Design Tutorial›Quorums and Patterns
System Design · Lesson 113 of 120

Case Study Patterns

What kept coming back.

⏱ 2 min read▶ Video at 2:17:38🎓 Free
Watch this lesson in the System Design courseWatch on YouTube ↗Full System Design course

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.

Case Study Patterns
From the video: Case Study Patterns
  • 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.

PatternAppeared in
Cachingshortener, feed, autocomplete
Queuesnotifications, video, feed
Shardingchat, key-value store
Object storage + CDNvideo, crawler
Precomputefeed, 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.

Read or write heavy?cache or queue
Ahead of time?precompute
Later?make it async
Split by?the shard key

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
Next up: Case Studies Quiz — test yourself