Ask HN: How would you design Instagram?
Cheers!
Cheers!
To clarify, they specifically ask about the Instagram feed.
Basic answer goes like this: v0: Webserver handling requests talking to a relational DB. Return feed via ORDER BY created_at DESC; v1: introduce CDNs to host image files closer to the client. v2: pre-compute user's feeds and store them in a NoSQL table.
Where I struggle: * Solving the "push" vs "pull" aspect. v2 doesn't work well for influencers with huge follower counts. How to handle this case? I suggested a blended approach but didn't have many ideas on how to knit them together. * Would you still pre-compute the feeds even if people haven't logged in for a long period of time? I said we could bucket users into different categories of usage via an offline job and re-fresh their feeds on different cadences and store them in different levels of caching.
Curious to hear how I can add more detail and extend my solution!
If you tried to clone instagram now, it would take years to replicate every feature (for a single dev).
A better answer is to say you would design instagram the way they originally did.... Start with a simple photo sharing platform and add features based on user feedback and demand.
That way you're solving problems people are having, not copying a solution that already exists.