CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
πŸŒ™β˜€οΈ
Log inStart free
Home/Templates/System Design Interview Classics

πŸ“ System Design Interview Classics Β· Data Flow

Social News Feed (Twitter-style)

How posts reach followers' feeds: fan-out on write for normal users, fan-out on read for celebrities, and a ranked feed built from a cache.

More System Design Interview Classics templates

Drawing diagram…

What this diagram shows

  • Normal users' posts are pushed to followers' feed caches
  • Celebrity posts are merged in at read time to avoid millions of writes
  • Feeds are ranked before they are shown

Prompt used

Data flow for a social feed: a post is saved in the post store and sent to a fan-out service. For users with fewer than 10,000 followers the fan-out service writes the post ID into each follower's feed cache in Redis. For celebrities it does nothing at write time. When a user opens the app, the feed service reads their cached feed, merges recent posts from celebrities they follow, ranks them, and hydrates post details from the post store.

Mermaid code
flowchart LR
  U[User] -->|New post| PS[Post Service]
  PS -->|Post| PDB[(Post Store)]
  PS -->|Post ID and author| FO[Fan-out Service]
  G[(Follower Graph)] -->|Followers| FO
  FO -->|Post ID per follower| FC[(Feed Cache - Redis)]
  R[Reader] -->|Open feed| FS[Feed Service]
  FC -->|Cached post IDs| FS
  CEL[(Celebrity Posts)] -->|Recent posts| FS
  PDB -->|Post details| FS
  FS -->|Candidates| RK[Ranking Model]
  RK -->|Ranked feed| R

Related templates

C4 ArchitectureProSystem Design Interview Classics

URL Shortener System Design

The classic interview design for a service like bit.ly: short code generation, fast redirects from a cache, and click analytics processed separately.

SequenceSystem Design Interview Classics

Chat App Message Delivery (WhatsApp-style)

How a one-to-one chat message is delivered in a WhatsApp-style system, with sent, delivered and read ticks, and push notifications when the receiver is offline.

C4 ArchitectureProSystem Design Interview Classics

Ride Matching System (Uber-style)

The core of a ride-hailing app: drivers stream their locations, a geo index finds nearby drivers, and a matching service offers the trip to the best one.

FlowchartSystem Design Interview Classics

API Rate Limiter (Token Bucket)

How a token bucket rate limiter decides whether to let an API request through, using Redis so all servers share the same counts.

DeploymentProSystem Design Interview Classics

Notification Service Design

A notification system that sends email, SMS and push messages at scale: one API, a queue per channel, user preferences, and retries.

Data FlowSystem Design Interview Classics

Search Autocomplete (Typeahead)

How search suggestions appear as you type: a prefix index built offline from past searches, served from memory, and refreshed regularly.