Functional
- Users see a chronological or ranked feed of posts from accounts they follow
- Feed page loads in under 200ms (p99) at all stages
- New posts appear in followers' feeds within 5 seconds
- Users can post photos; posts are visible immediately to the poster
- Pagination: feed returns 20 posts per page with cursor-based pagination
Non-functional
- Stage 1 (2k rps): $1,000/month budget
- Stage 2 (10k rps): $3,000/month budget
- Stage 3 (40k rps): $8,000/month budget
- Feed reads under 200ms p99 at every stage
- Survive a region-A outage with less than 5% error rate (Stage 2+)
- New posts visible in feed within 5 seconds of posting (soft staleness budget)
Failure scenarios
- ⚡ Stage 1 -- Seed (2k rps)
- ⚡ Stage 2 -- Series A (10k rps)
- ⚡ Stage 3 -- Series B (40k rps)
- ⚡ Region A DB outage (Stage 2+)
Approach guide
- 1.Phase 1 -- Stage 1 Baseline: Make 2k rps Work10m
- 2.Phase 2 -- Stage 2 Cache Strategy: Handle 10k rps15m
- 3.Phase 3 -- Stage 3 Fan-Out: Solving the Celebrity Problem20m
- 4.Phase 4 -- Graceful Degradation and DB Availability15m
- 5.Phase 5 -- Cost Discipline Across All Three Stages15m
Full guide on the brief page.
Key numbers
- Stage 1 feed read throughput1,800 rps
- Stage 1 write throughput200 rps
- Stage 2 feed read throughput9,000 rps
- Stage 3 feed read throughput36,000 rps
- Social graph query cost at Stage 1~5ms