System Design · Case Studies

Case Study: Social Feed

Design, trade-offs, and alternatives for a social news feed at scale.

01
Chapter One

Problem Statement

Problem Statement
Coming Soon
Problem Statement
This chapter covers social feed scale: users, posts per day, feed reads QPS, latency SLA, and the celebrity problem.
📋 Chapter 1 — Summary
  • Summary content pending.
02
Chapter Two

Questions to Ask

Questions to Ask
Coming Soon
Questions to Ask
This chapter covers key questions: chronological vs ranked feed, follow vs friend model, content types, pagination.
📋 Chapter 2 — Summary
  • Summary content pending.
03
Chapter Three

Naive Design

Naive Design
Coming Soon
Naive Design
This chapter covers fan-out on read: aggregating a feed at query time and why it breaks at celebrity follower counts.
📋 Chapter 3 — Summary
  • Summary content pending.
04
Chapter Four

Refined Design

Refined Design
Coming Soon
Refined Design
This chapter covers hybrid fan-out: pre-computed fan-out on write for normal users, fan-out on read for celebrities.
📋 Chapter 4 — Summary
  • Summary content pending.
05
Chapter Five

Alternatives

Alternatives
Coming Soon
Alternatives
This chapter covers two approaches: fan-out on write vs fan-out on read — trade-offs in freshness and storage.
📋 Chapter 5 — Summary
  • Summary content pending.
06
Chapter Six

Real Companies

Real Companies
Coming Soon
Real Companies
This chapter covers how Twitter, Instagram, and LinkedIn handle feed generation for their scale and data model.
📋 Chapter 6 — Summary
  • Summary content pending.
07
Chapter Seven

Best Practices

Best Practices
Coming Soon
Best Practices
This chapter covers cursor-based pagination, feed cache warming, separate read/write paths via CQRS.
📋 Chapter 7 — Summary
  • Summary content pending.
08
Chapter Eight

What Could Go Wrong

What Could Go Wrong
Coming Soon
What Could Go Wrong
This chapter covers stale feeds after unfollow, thundering herd on celebrity post, infinite scroll breaking at depth.
📋 Chapter 8 — Summary
  • Summary content pending.