Real-World Designs · 10 min read · Intermediate
Case Study: Design a Social News Feed
Compare fan-out-on-write (push) vs fan-out-on-read (pull) and design a hybrid feed that handles celebrity accounts cleanly.
What you'll learn
- Contrast push fan-out vs pull fan-out latency and write amplification
- Design a hybrid model for normal users vs high-follower accounts
- Paginate feeds reliably with cursor pagination instead of OFFSET
Overview
Compare fan-out-on-write (push) vs fan-out-on-read (pull) and design a hybrid feed that handles celebrity accounts cleanly.
Great system design is about explicit trade-offs rather than memorizing buzzwords. Every architectural layer you add (caches, replicas, queues, shards) solves one bottleneck while introducing new operational failure modes.
Design Checklist
| Dimension | Questions to Ask |
|---|---|
| Traffic & Scale | What is the read-to-write ratio, peak QPS, and payload size? |
| Consistency | Can users tolerate eventual consistency for a few seconds, or do we need strict ACID? |
| Failure Modes | What happens if a cache node, replica, or downstream API times out? |
| Simplicity | Can a single well-indexed PostgreSQL instance handle the next 12 months of growth? |
Key Takeaways
- Contrast push fan-out vs pull fan-out latency and write amplification
- Design a hybrid model for normal users vs high-follower accounts
- Paginate feeds reliably with cursor pagination instead of OFFSET
Quick Check
Check Your Understanding
Score: 0 / 1
1. Why does pure fan-out-on-write break down when a celebrity with 20 million followers posts an update?
Study Workspace
Finished this lesson?
Your progress is saved locally in your browser, no account needed.