Dashboard/System design/34. Design Instagram

SYSTEM DESIGN · LESSON 34 OF 52 · 10 MIN VIDEO · 4 TOPICS

Design Instagram

Module Progress (0 / 4 Lessons Completed)0%
System design Track (0 / 52 Modules) · Overall 0/80 (0%)0%
⌁

Narrated HD Video Lesson (10 min) · Pro

Lesson Overview + Section #01 + RESHADED Checklist + Quiz #1 are unlocked free below (no login required). Unlock all 80 HD video lessons and deep-dive sections — or watch our two free sample video lessons first.

0% READSec 01/04 · System Design: Instagram
SYSTEM DESIGN VIDEO LESSON & GUIDE

Design Instagram

Designing Instagram requires pairing a petabyte-scale, zero-loss media ingestion and delivery pipeline (1.23 PB/day raw uploads, 449 PB/year, and 5.7 Tbps peak-amplified egress) with a sub-200 ms personalized feed serving 500,000,000 daily active users (579,000 RPS average, 1,158,000 RPS peak). Every architectural decision stems from two asymmetries: binary media files are orders of magnitude larger than metadata rows, and posts are viewed roughly 50 times more often than they are uploaded. L4–L6 interviewers test microservice workload isolation (Upload vs. Social vs. Feed), polyglot database partitioning (SQL vs. Cassandra sharded by user_id), edge CDN offload, and hybrid push/pull feed materialization.

WHAT YOU WILL MASTER IN THIS LESSON
  • Quantify petabyte-scale media storage (60M photos * 3 MB + 35M videos * 30 MB = 1.23 PB/day, 449 PB/year) and asymmetric network bandwidth (114 Gbps ingress vs. 5.7 Tbps egress).
  • Isolate slow, bandwidth-heavy binary uploads into object storage (S3) and multi-tier CDNs away from latency-critical metadata, social-graph, and feed microservices.
  • Select storage engines per access pattern—relational SQL for users/follows and wide-column Cassandra sharded by user_id for posts/likes—backed by leader-follower replication.
  • Scale feed reads across 500M DAU using a 2 TB ID-only Redis Feed Cache populated by asynchronous hybrid push/pull fan-out workers.
SYSTEMATIC INTERVIEW CHECKLIST · RESHADED + 45-MIN CLOCK

8-Step RESHADED Execution Checklist

Follow this exact sequence from the Intro narration on every system design prompt so you never miss requirements, math, contracts, or the 13-minute deep dive.

0 / 8 Checked
INTERVIEWER SCORECARD · WHAT MAKES A STRONG HIRE?

5 Signals Bar Raisers Grade (L4 vs. L5 Senior vs. L6 Staff)

Senior (L5 / E5 / Senior SDE) Bar — Autonomous Pacing, Depth & Proactive Trade-Offs: Owns the 45-minute clock without prompting, derives every component quantitatively, surfaces failure modes (hot shards, stampedes, dual writes) BEFORE being asked, and defends consistency vs. latency trade-offs.
1. Scoping
✓ STRONG HIRE SIGNAL

Clarifies users, read/write skew, p99 latency, consistency bounds, and explicit non-goals in minutes 2–8.

✗ NO-HIRE RED FLAG

Jumps straight into drawing load balancers and microservices at minute 2 without asking a single question.

2. Right-Sized Design
✓ STRONG HIRE SIGNAL

Starts with the simplest working architecture justified by the math (e.g., 1 NVMe SQL primary + replicas + Redis for 40 writes/s & 3 TB).

✗ NO-HIRE RED FLAG

Recites a memorized Kafka + multi-DC Cassandra diagram that contradicts their own traffic calculations.

3. Technical Depth
✓ STRONG HIRE SIGNAL

Drives deep into 1–2 hard bottlenecks (partition keys, hot-key mitigation, transactional outbox, KV-cache batching) at minute 27.

✗ NO-HIRE RED FLAG

Skims across 12 boxes at identical buzzword depth and runs out of time before the deep dive.

4. Explicit Trade-Offs
✓ STRONG HIRE SIGNAL

Uses 3-part reasoning: 'A queue here because SMTP spikes to 3 s; checkout stays <60 ms, and we accept eventual email delay + retry dedup.'

✗ NO-HIRE RED FLAG

Name-drops tools ('We put Kafka and ZooKeeper here') without stating the alternative or operational cost.

5. Communication
✓ STRONG HIRE SIGNAL

Thinks aloud every 30–45s, checks alignment at phase transitions, and treats 'What if X fails?' as a cue for where points are awarded.

✗ NO-HIRE RED FLAG

Goes silent for 5 minutes while drawing or defends a flawed assumption defensively when nudged.

ARCHITECTURE & DATA-FLOW SLIDES · SLIDE 1 OF 1Section 01: System Design: Instagram
ARCHITECTURE / DATA FLOW DIAGRAM
1 writeAnaposts a photo500 M daily usersInstagramfeedBenfollowerCarafollowerDevfollower
SECTION 01 OF 4

1. System Design: Instagram

★ FREE PREVIEW
Key Takeaway: Instagram unites a petabyte-scale immutable object store with a read-heavy social graph, requiring strict physical separation between binary media delivery and low-latency feed metadata.
ARCHITECTURE / DATA FLOW DIAGRAM
1 writeAnaposts a photo500 M daily usersInstagramfeedBenfollowerCarafollowerDevfollower

Media Sharing Meets the Social Graph

At single-user scale, Instagram's loop is straightforward: a creator captures a photo or short video, uploads it with a caption, and shares it with followers who scroll their personalized news feeds, tap like, and post comments. Multiplied across 1,000,000,000 registered accounts and 500,000,000 DAU uploading 95,000,000 photos and videos daily, the engineering challenge shifts from storing individual files to sustaining massive read fan-out. Every uploaded asset is fetched dozens to millions of times across heterogeneous mobile screens and network speeds.

  • Binary vs. Metadata Split: Multi-megabyte photos and videos are immutable blobs, whereas captions, timestamps, follows, and likes are tiny structured records (< 200 B).
  • Extreme Read Dominance: Views, feed scrolls, and profile loads outnumber media uploads by 50:1+, making read caching and edge delivery the primary cost and latency drivers.

Why Binary Payloads Reshape Social Architecture

Compared with text-first microblogging, Instagram's write path ingests 1.23 PB/day of dense visual media, and its read path streams multi-terabit visual feeds. Routing binary uploads and downloads through the same application servers and databases that serve social-graph queries would saturate server NICs, exhaust thread pools on slow cellular uploads, and bloat database page caches.

Workload DimensionWrite Path RealityRead Path RealityArchitectural Consequence
Payload Size3 MB average photo; 30 MB short videoMulti-resolution thumbnails & adaptive video streamsStore files in Blob Store (S3); databases store only media_url pointers
Traffic Amplification95M media uploads/day (~1,100 uploads/sec)~50+ views per upload; 579,000 API RPS avgPrecompute feed post IDs in RAM and serve 95%+ of bytes from edge CDN PoPs
Connection DurationSeconds-long cellular binary uploadsSub-200 ms JSON metadata fetchesIsolate Upload Service fleet so slow uploads never starve Feed Service threads
SECTION 02 OF 4

2. Requirements of Instagram's Design

🔒 PRO SECTION
Key Takeaway: Deliver sub-200 ms feed latency, 99.999999999% media durability across 449 PB/year of uploads, and 5.7 Tbps of read throughput by trading global read-after-write linearizability for eventual consistency.

Section 1 + Checkpoint Quiz #1 are unlocked free outside the paywall. Unlock all architecture slides, QPS & sharding trade-off tables, and all 80 narrated HD video lessons with Full Access — or inspect our sample payment system lesson first.

SECTION 03 OF 4

3. Design of Instagram

🔒 PRO SECTION
Key Takeaway: Split traffic across dedicated Upload, Social, and Feed microservices backed by relational SQL for account invariants, wide-column Cassandra for high-velocity posts/likes, and S3 + CDN for media.

Section 1 + Checkpoint Quiz #1 are unlocked free outside the paywall. Unlock all architecture slides, QPS & sharding trade-off tables, and all 80 narrated HD video lessons with Full Access — or inspect our sample payment system lesson first.

SECTION 04 OF 4

4. Detailed Design of Instagram

🔒 PRO SECTION
Key Takeaway: Combine hybrid push/pull fan-out workers with a 2 TB ID-only Redis Feed Cache and user_id-sharded replicated post databases to keep both home feeds and profile grids single-lookup fast.

Section 1 + Checkpoint Quiz #1 are unlocked free outside the paywall. Unlock all architecture slides, QPS & sharding trade-off tables, and all 80 narrated HD video lessons with Full Access — or inspect our sample payment system lesson first.

ACTIVE RECALL & TRADE-OFF PROBES

System Design Checkpoint Quizzes (1)

CHECKPOINT QUIZ #1

In "System Design: Instagram" (Why Binary Payloads Reshape Social Architecture), how does a production-grade design handle "Traffic Amplification" (Architectural Consequence)?