Image hosting service inspired by Imgur and Cloudinary: uploads go to object storage with a small metadata row, a CDN serves viewers from the edge, and thumbnails are made in the background.
See why storing image bytes in database rows and serving them from one server breaks down.
What was missing: Nothing is separated: one server handles uploads and views, and image bytes sit inside database rows.
Why that's risky: Reading a 3 MB image streams it through the database and evicts hot rows from its buffer cache; at 10K views/s the database saturates first (125% load).
What gets added: A single server and a database where each image is one row holding megabytes of bytes.
Trade-offs: Simplest to build, with transactional uploads, but databases are tuned for small rows, not blobs.
Keep image bytes in object storage and only small records in the database.
What was missing: Image bytes live in database rows and one process does everything.
Why that's risky: Every view still costs a metadata lookup plus a storage fetch, and a viral image repeats that same fetch thousands of times a second.
What gets added: Image bytes move to object storage and the database keeps only a small row per image (owner, size, object key). The upload service hands the client a short-lived signed link, so bytes go straight to storage and never pass through our servers.
Trade-offs: Two stores can disagree: if the bytes upload but the row insert fails you leave an orphan object, so write the object first and sweep unreferenced objects later.
Serve popular images from the edge and from memory so viral images never reach storage.
What was missing: Popular images are fetched from storage again on every single view.
Why that's risky: A cold cache or a CDN outage sends full traffic to the view service at once, and a deleted image keeps serving from the edge until its copy expires.
What gets added: A CDN serves images from edge locations near viewers, and a hot-image cache sits behind the view service for what the CDN misses.
Trade-offs: An image never changes after upload, so its URL can be cached at the edge for a year; the cost is that a delete needs an explicit purge, or the image lingers until the copy expires.
Protect uploads from abuse and make thumbnails in the background.
What was missing: Uploads are unprotected, thumbnails are not made, and no one can see problems.
Why that's risky: If thumbnails were made inside the upload request, a burst of 10 MB photos would block uploads for everyone.
What gets added: A rate limiter in front of uploads, a queue feeding thumbnail workers that write small and medium versions, and a monitoring service.
Trade-offs: Upload returns as soon as the bytes are stored, so a thumbnail can appear a few seconds late; clients show the original until it is ready.
You're in the middle of an interview session. Leaving now will end your current attempt.
Explore concept overviews, real-system examples, key tradeoffs, and interview talking points for each roadmap section.
You've conquered this phase. These are the skills you now own: