feedsfanoutlatencycost
Fanout-on-Write vs Fanout-on-Read
Choose when feeds/timelines are precomputed at write time versus assembled at read time.
Definition
Fanout-on-write pushes updates to follower timelines proactively; fanout-on-read computes results during request.
When To Use
- Fanout-on-write for high read, moderate write workloads with predictable follower sets.
- Fanout-on-read for high write or celebrity-skew workloads to avoid write explosion.
- Hybrid strategies where heavy users use read-time composition.
When Not To Use
- Single strategy for all users when follower distribution is highly skewed.
- Without cache/projection strategy for read-time joins.
- Without backpressure controls for bursty write fanout.
Tradeoffs
- Write fanout lowers read latency, but can explode write amplification.
- Read fanout saves write cost, but increases read compute and tail latency.
- Hybrid improves efficiency, with more routing complexity.
Common Failure Modes
- Celebrity posts overload write fanout pipeline.
- Read-time joins timeout under hot traffic spikes.
- Stale projections show inconsistent feed ordering.
Interview Framing
Use this structure when the interviewer asks for this pattern explicitly.
Quantify follower distribution, write/read QPS, and explain hybrid cutoff policy for large accounts.
Related Project Deep Dives
News Feed & Timeline Service
Design a globally distributed news feed system that supports real-time post ingestion, personalized ranking, fanout, and low-latency timeline reads at massive scale.
Multi-Channel Notification System
Design a globally distributed notification platform that delivers email, push, SMS, and in-app messages reliably with user preferences, rate limits, and delivery observability.
Related Concepts
Backpressure
Control producer rate based on downstream capacity to avoid queue explosions and cascading failures.
Sharding Strategies
Partition data/work across shards to scale throughput and storage while controlling skew.
Dead-Letter Queue (DLQ)
Isolate repeatedly failing messages for triage without blocking healthy traffic.