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

Social-feed cases: design and defend a feed-backed app

Hands-on project: produce a design doc for a social app with a news feed, notifications, and presence — choosing fan-out strategies, the celebrity hybrid, delivery guarantees, and ordering — then justify each threshold with a number and validate the riskiest with a prototype.

SDC Senior ◷ 240 min
Level
FoundationsJuniorMiddleSenior

Knowing each case in isolation is not the same as composing them into one coherent system a staff engineer would sign off on. Take a real-shaped social app, write the design doc end to end — feed, notifications, presence, with every fan-out and consistency choice justified by a number — and then prove your two riskiest decisions with a prototype, not a hand-wave.

This project makes the unit operational: you integrate the four cases into one system, decide each tradeoff against an estimate, and measure to confirm the two predictions most likely to bite — the celebrity fan-out cost and the at-least-once-plus-dedup delivery guarantee.

Project
0 of 9
Objective

Produce a complete design doc for a social app (a short-form posting app with a home feed, push/email notifications, and presence), making and justifying the fan-out, hybrid, delivery, and ordering decisions from the unit — then build a small prototype that empirically validates your celebrity fan-out strategy and your at-least-once-with-dedup notification path.

Requirements
Acceptance criteria
  • A design doc readable in a few minutes: load estimates (avg + peak, one significant figure), the read:write ratio, and the fan-out/hybrid/delivery/ordering decisions, each citing the number that drives it.
  • An explicit celebrity threshold with the arithmetic that sets it, plus the feed-cache and pagination design.
  • A working prototype whose measurements show the celebrity write storm under pure push and its removal under the hybrid, with the threshold and follower counts that produced each.
  • A delivery demonstration: a fault-injection run where duplicates are collapsed by the idempotency key and permanently-failed sends land in the DLQ, with the before/after duplicate counts.
  • A short write-up: one paragraph on what the estimate revealed before any code, and one on where the prototype's behavior differed from the napkin and why.
Senior stretch
  • Add a chat surface: persistent WebSocket connections, a connection registry, and per-conversation sequence numbers; demonstrate consistent ordering and reconnect-and-sync via the sequence as a cursor.
  • Add autocomplete for user/topic search: an offline build of a trie with top-k per node, and show the read path is an O(1) lookup versus a live log scan.
  • Add presence: show the fan-out trap (a popular user's online event) and implement pull-for-visible-contacts instead, measuring the update volume difference.
  • Recompute the whole plan under 10x growth and identify the first threshold you cross (feed-cache shard, DB shard, more gateways), demonstrating how the estimate reshapes the design as inputs scale.
Recall before you leave
  1. 01
    What load estimates drive the feed and notification design, and how does each become a decision?
  2. 02
    How do you validate the two riskiest decisions in a prototype?
  3. 03
    Why design and estimate first, then prototype, rather than building immediately?
Recap

This project composes the four cases into one system and forces every decision to rest on a number. You write a design doc for a feed-backed social app: estimate feed-read, post-write, and notification QPS (avg and peak, one significant figure), derive the read:write ratio, and use it to choose fan-out-on-write as the feed default with a celebrity threshold that the arithmetic sets, plus a capped feed cache and cursor pagination. You specify the notification pipeline (async fan-out, per-channel queues, idempotency key, retry+jitter into a DLQ, a transactional priority lane) with an explicit at-least-once-plus-dedup guarantee, and you state which surfaces are eventually consistent and why. Then you close the loop: a prototype that shows the celebrity write storm vanish under the hybrid, and a fault-injection run where the idempotency key collapses duplicates while the DLQ captures failures. Estimate first, validate second — the napkin tells you the shape and the riskiest predictions; the prototype confirms them. An engineer who has built this once composes social systems deliberately instead of discovering the celebrity tail in production.

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.