open atlas
↑ Back to track
System Design Case Studies SDC · 02 · 05

Social-feed cases: multiple-choice review

Multiple-choice synthesis across the social-feed cases: notification fan-out and the retry storm, the feed's fan-out tradeoff and the celebrity hybrid, chat's server-push and per-conversation ordering, and autocomplete's precompute-offline rule.

SDC Senior ◷ 13 min
Level
FoundationsJuniorMiddleSenior

Four decisions across the unit’s four cases — each a choice you make in a design review, not a definition to recite. The thread tying them together is the same one that runs through every read-heavy social system: do the expensive work once, on the write or build side, and keep the user-facing path a cheap lookup.

Confirm you can name the missing dedup guard in a notification retry storm, route a celebrity through the feed hybrid, impose consistent chat ordering without global coordination, and reject a live-per-keystroke autocomplete.

Quiz

A notification provider recovers from an outage and the backlog re-flushes; users get the same push 5–9 times. Retries with backoff are already in place. What single piece is missing?

Quiz

Your news feed uses fan-out-on-write, but a celebrity's 30M-follower post causes a write storm that stalls everyone's feed. What is the standard fix?

Quiz

Two chat users on different gateways message rapidly; messages render out of order and one duplicates after a reconnect. How do you get consistent ordering and no duplicates?

Quiz

An autocomplete queries the search logs on each keystroke to rank matching queries; it is 600 ms slow and overloads the cluster. What is the architectural fix?

Recall before you leave
  1. 01
    Why do notification retries need an idempotency key, and why does the feed need a hybrid?
  2. 02
    How do chat ordering and autocomplete serving each avoid doing expensive work on the user path?
Recap

The four cases rhyme. A notification system retries at-least-once, so it needs an idempotency key to avoid the retry storm — retries without dedup duplicate. A news feed is read-heavy, so it pushes (fan-out-on-write) for normal authors but pulls celebrities in a hybrid, because the power-law tail breaks any single strategy. A chat system orders messages with a per-conversation sequence number assigned at persist time — a total order where it matters, with no global coordination — and dedups on a message id. Autocomplete never ranks live per keystroke; it serves a precomputed top-k from a trie built offline, an O(1) read behind an edge cache. The unifying principle across all four: do the expensive work once, on the write or build side, and keep the user-facing path a cheap, safe lookup.

Connected lessons

Something unclear?

Ask a question about this lesson. Questions are anonymous and go straight to the author to make the lesson better.

shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources3
expand
  1. 01
  2. 02
  3. 03

Trademarks belong to their respective owners. Editorial reference only.