Instagram — system-design tick-by-tick request flow

· updated

A single-file in-browser walkthrough of what actually happens inside an Instagram-shaped backend when you open the app, post a photo, run a search, fetch a static image, or get a push notification. Every operation — DNS lookup, TLS handshake, cache hit/miss, shard lookup, blob upload, fanout job — is animated one step per 0.5 s tick with a live event log on the left so you can see exactly which subsystem is doing what.

The architecture is the canonical interview-grade one from the GeeksForGeeks diagram: DNS, Client, Load Balancer, two API gateways, read/write App Servers, a Redis/Memcached cache with Shard Manager in front of sharded Metadata DBs, a Notification Service + queue, a Search Aggregator over Elastic Search, a CDN backed by Blob Storage, a Video/Image Processing Service with workers, and a Feed Generation Service draining a fanout queue.

Open fullscreen ↗

Scenarios

The sim cycles through five real flows. Click a tab on the toolbar to jump.

ScenarioWhat it walks
App launchCold start: DNS query → resolver answer → TLS to LB → API Gateway routing GET to App Server (read) → cache MISS → Shard Manager lookup → Metadata DB → cache populate → JSON back through the gateway → client renders feed.
Photo uploadMultipart POST → LB → API Gateway 2 → App Server (write) → enqueue on Video Processing Queue → worker picks up → transcode + thumbnail → PUT to Blob Storage → enqueue Feed Generation Queue → Feed Gen Service writes denormalised feed entries to 1 200 followers + drops PushNotif messages.
SearchGET /search?q=… → App Server (read) → Search Results Aggregator → Elastic Search index (own LRU cache) → 40 doc IDs → hydrate metadata via mget → merged result back to client.
CDN fetchPure static-content path: GET image URL hits CDN POP directly. On miss the CDN pulls from Blob Storage; on hit the request never touches the app servers.
Push notificationFeed Generation Service drops a fanout job in the Notification Queue → Notification Service drains, signs APNs/FCM JWT, pushes to the user’s device (modelled as a direct edge from notif service to client).

How to read it

Controls

Key / mouseAction
spaceRun / pause
sStep one tick (0.5 s simulated)
shift+sStep ×10
rReset
Scenario tabsJump to that scenario (launch / upload / search / cdn / push)
Speed sliderWall-clock tempo of the run loop
hover any nodeLive explanation tooltip

What’s “precise” about it

Reference

The diagram is the GeeksForGeeks “Instagram System Design” reference image. This sim animates that exact topology end-to-end with synthetic but realistic traffic.

← systems