Urgent.News

What's breaking now, across thousands of outlets.

Tech

HLD: Instagram Feed

Design a photo-sharing platform where users post photos and see a feed of photos from people they follow. 1️⃣ Clarify Requirements Functional Requirements Upload photos/videos Follow/unfollow users View home feed (photos from followed users, newest first) Like, comment on photos User profile with photo grid Non-Functional Requirements High availability Eventual consistency for feed (seconds lag…

Instagram aims to create a photo-sharing platform where users can easily upload and share photos and videos. The application will feature a feed showcasing photos from users a person follows, displayed in a chronological order with the most recent posts appearing first. Users will be able to like and comment on photos, and each user's profile will display a grid of their photos.

Functional requirements include the ability to upload photos and videos, follow and unfollow users, view a home feed, like and comment on photos, and view a user's profile. Non-functional requirements involve ensuring high availability and eventual consistency for the feed, with a low latency of around 200 milliseconds for feed loading.

The system must handle a significant amount of traffic, processing 100 million photos daily, equating to approximately 1,160 uploads per second and 58,000 read queries per second. To support this massive scale, the platform will employ a tiered storage system with Amazon S3 for hot data, S3 Infrequent Access for warm data, and S3 Glacier for cold data.

To serve photos, the platform will leverage a CDN, never serving images directly from origin servers. The feed generation process employs a hybrid fan-out approach, combining push updates for regular users and read fan-out for celebrities, merged at read time using a Redis cache. The database schema consists of tables for storing photo metadata, the social graph (followers and following), and other essential data structures.

Key challenges include handling the scale of data storage, ensuring efficient upload patterns, and implementing a hybrid feed generation strategy for both regular and celebrity users. By employing a combination of Amazon S3, CDN, Redis, and Cassandra, Instagram aims to provide a seamless and scalable photo-sharing experience for millions of users worldwide.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

My New Portfolio.

𝗚𝗮𝘄𝗮𝗱’𝘀 𝗦𝘁𝗲𝗹𝗹𝗮𝗿 𝗦𝘆𝘀𝘁𝗲𝗺: “𝗔 𝘂𝗻𝗶𝘃𝗲𝗿𝘀𝗲 𝘄𝗵𝗲𝗿𝗲 𝘂𝗻𝗶𝗾𝘂𝗲𝗻𝗲𝘀𝘀 𝗮𝗻𝗱 𝗵𝗮𝗿𝗺𝗼𝗻𝘆 𝗮𝗿𝗲 𝗲𝘃𝗲𝗿𝘆𝘁𝗵𝗶𝗻𝗴.” While working on my portfolio, I realized that a…

  • My New Portfolio features planets and a spaceship, not traditional static websites
  • Creator Gawad uses TypeScript, React 18, Three.js, custom GLSL shaders
  • Website not mobile-optimized, Gawad actively addressing this issue

More from Saturday 29 August →