Preparing your design workspace

Loading the problem and your latest saved attempt…

Design Image Serving for a Home-Listing Site

Store the photos agents upload for home listings and get them to shoppers' browsers quickly, deciding which copies of each photo live in the browser and which on the site's own servers.

Problem statement

Design how a home-listing website stores its listing photos and gets them to shoppers quickly. Part of the discussion is where copies of each photo should be kept: in the shopper's browser, on the site's own servers, or both.

For this exercise, assume the following. - Real-estate agents upload photos for each listing they manage. Shoppers browse in a web browser, often on a phone. - A search results page shows one small photo (a thumbnail) per listing. A listing's own page shows all of its photos at a large size.

- Agents sometimes replace or remove a photo, for example after a home is repainted or when a photo was added by mistake. - Only still photos are in scope. Video, 3D tours, photo editing, how listings are searched, and agent sign-in are out of scope.

What to build

  1. An agent can upload up to 50 photos to a listing; each photo appears on the listing within 1 minute of upload.
  2. Shoppers receive each photo at a size that fits where it is shown: a thumbnail in search results, and a large photo sized to the screen on the listing page.
  3. When a shopper comes back to a page, photos the browser already loaded are shown without downloading them again.
  4. An agent can replace or remove a photo; within 10 minutes the old photo no longer appears on the listing page or in search results.

At scale

  • About 1 million active listings with about 25 photos each. An uploaded original averages 3 MB, so the originals total about 75 TB.
  • At peak, 20,000 photo requests per second, about 80% of them thumbnails. A search results page shows up to 40 thumbnails.
  • About 50,000 new photos are uploaded per day.
  • On a phone, the thumbnails on a search results page should appear within about 1 second.