Instagram Architecture
How Instagram stores photos and builds the news feed: upload service, object storage behind a CDN, feed generation, the follower graph and caching.
How it flows
- Mobile Clients → Load Balancer (HTTPS)
- Load Balancer → API Servers (REST)
- API Servers → Cache (Read/Write)
- API Servers → Photo Upload Service (REST)
- API Servers → News Feed Service (REST)
- API Servers → Notification Service (Event)
- Photo Upload Service → Object Storage (S3 PUT)
- Object Storage → CDN (Origin Pull)
- CDN → Mobile Clients (HTTPS (media))
- News Feed Service → Followers Graph (Graph Query)
- News Feed Service → Cache (Feed Cache)
- Photo Upload Service → Notification Service (Kafka)
Components
Mobile Clients · Load Balancer · API Servers · Photo Upload Service · News Feed Service · Notification Service · Object Storage · CDN · Followers Graph · Cache