Card 10/ 11
Practice: Placing the Parts for a Photo-Sharing Site
Uploads, a feed and profile pictures: which part serves each one?
Placing each job on the right part, tracing a request, and finding the single point of failure are practised together on one brief here. Decide each answer before opening the reveal.
The brief. A photo-sharing site lets users upload photos, see a feed of photos from people they follow, and show a profile picture beside every name. It runs one load balancer, three application servers that keep each user's session in their own memory, one database with no replica, and stores photos in object storage.
- Which part should serve profile pictures to readers around the world?
- In what order does a request to load the feed pass through the parts?
- Which parts are single points of failure, and what else in the brief stops the servers being interchangeable?
Check your answers
- A CDN. Profile pictures are static and the same for every reader, so edge copies near each reader serve them faster and take the load off the servers.
- DNS, load balancer, application server, cache, database, and back. The brief has no cache yet; with one, the server checks it before the database.
- The load balancer and the database each have no spare. The servers are not interchangeable either: sessions held in their memory tie each user to one server. Moving sessions to a shared store makes them stateless, and a replica plus a second load balancer remove the two single points.
← → move through sections and cards