[SYSTEM DESIGN] Instagram
PremiumFull Instagram architecture: post upload, feed generation (fan-out on write), social graph, engagement. Covers pre-signed URLs, cache-aside, CQRS, event-driven patterns.
Что внутри
Photo Sharing Feed
This is an illustrative target, not a claim about Instagram production: 30 million daily active users, 15 million posts/day, 1.3 billion feed loads/day and 250 million likes/day. Those inputs imply about 174 posts/s, 15,046 feed loads/s and 2,894 likes/s on average. Example peaks are 1,000 posts/s, 50,000 feed loads/s and 8,000 likes/s. At 2.4 MB per post, direct uploads peak near 2.4 GB/s; clients therefore upload to object storage rather than proxying bytes through application servers.
Correct write path
The media service reserves an owner-scoped key and issues a short-lived SigV4 presigned PUT constrained by key and checksum. Finalization performs HEAD-style metadata validation for owner, size, content type and checksum. A scan/thumbnail consumer decodes with hard resource limits and writes deterministic derivatives. A post can reference only MEDIA_READY objects.
PostgreSQL holds canonical relationships, post metadata and an outbox. A domain mutation and its outbox row commit in one transaction. The relay may publish more than once, so every event has a stable ID and every projector is idempotent. Cassandra is a query model, not a relational database queried arbitrarily: posts_by_id supports feed hydration; posts_by_user supports profiles, backfill and celebrity pull-on-read. Independent consumer groups can make a feed ID visible before its Cassandra projection; the read path suppresses/retries a missing projection until the projector catches up. Horizontal scaling still requires deliberate partition sizing, compaction, repair and capacity work.
Feed and likes
Полный разбор, ADR-ы, сценарии и deep dives — после оплаты бандла.
System Design Cases
Полный доступ ко всем кейсам бандла
Premium открывает полный разбор для подготовки к интервью
- Где архитектура ломается первой и как защищать выбранный дизайн.
- Конкретный capacity math: размеры данных, throughput и пороги масштабирования.
- Trade-off-ы в стиле ADR, которые легко превращаются в структурированный ответ.
- Запускаемые сценарии: happy path, отказы, retry и recovery.
Регистрация бесплатна. Оплата — следующим шагом, из этого же кейса.
Уже есть аккаунт?