
Learn system design by building Instagram from scratch. See how it grows from 1 user to millions.
Users can upload photos, follow friends, and scroll through a personalized feed.

Just You and Your Friends
Start simple. One user posts a photo, their friends see it. Learn the basics of how data flows. This is how Instagram started in 2010 with Kevin Systrom and 100 beta users.
When a user opens Instagram, their phone sends a request to Instagram's server. The server fetches photos from the database and sends them back to display in the feed.
Click to learn more:

Thousands of People Join
Your app is getting popular! But it's getting slow. Learn how to handle more traffic without breaking. Instagram hit this at 100K users in 2010 and added caching and load balancing.
Thousands of users hit Instagram at once. The load balancer distributes requests across multiple servers to prevent any single server from being overwhelmed. Servers check the cache first (faster) before hitting the database.
Click to learn more:

Millions of Photos Daily
Now you're huge. People are posting and scrolling constantly. Time to optimize for speed and storage. Instagram reached 30M users in 2012, moved to AWS, and added a CDN for images.
Photos are served from a CDN for lightning-fast loading. The load balancer routes requests to servers, which use cache for speed. The primary database handles writes, while read replicas handle the massive read traffic from millions of users scrolling their feeds.
Click to learn more:

Handle Failures and Abuse
Servers crash. Users spam. Hackers attack. Learn how to keep your app running and secure. Instagram today serves 2B users with 99.99% uptime and advanced security systems.
Every request goes through authentication (are you logged in?) and rate limiting (are you spamming?). The load balancer distributes traffic to servers. Background tasks like sending notifications are handled by message queues to avoid slowing down the main app.
Click to learn more: