Related Coding:
Requirements:
- The system must handle 10 million Daily Active Users (DAU).
- A user can publish a post.
- A user can see friends’ posts on their news feed page.
- Each user can have up to 5000 friends.
- The news feed is sorted by reverse chronological order (latest posts first).
- No ranking algorithm (e.g., topic scores or friend closeness) is required for this version.
Feed publishing
- Post service: persist post in the database and cache.
- Fanout service: push new content to friends’ news feed. Newsfeed data is stored in the
cache for fast retrieval.
- Notification service: inform friends that new content is available.

Source: ByteByteGo https://bytebytego.com/courses/system-design-interview/design-a-news-feed-system
Post Service
Learn from the picture.
Fanout Service (Write-through caching)
Fanout is the process of delivering a post to all followers (or friends). It is a Write-through cache for Post DB specific for feeds.
Pros: