cloudpatterns.appClassroomKatasWhiteboardBlog
Kata

Pixel goes viral

Pixel Moments, Pixel's new sister app, launched on the design Pixel had on its own launch day: one web tier of two large servers, whose APIs pass every photo on from the bucket, send feed reads and likes to one database, and make every upload wait while its followers are notified.

30 minHard

Members kata

Membership isn’t open yet. One kata or case is open to you now, 1 more with a free account.

The canvas opens for members

The brief

Pixel Moments, Pixel's new sister app, launched on the design Pixel had on its own launch day: one web tier of two large servers, whose APIs pass every photo on from the bucket, send feed reads and likes to one database, and make every upload wait while its followers are notified. (Uploaded bytes go to the bucket by signed URL; the uploads API only records the post and notifies.) Then a photo takes off: after a quiet minute, every kind of traffic climbs eightfold over about 70 seconds — photo views from 300 to 2400 a second, feed reads, likes and uploads with them — holds, then falls back. Keep Moments serving through the whole wave, uploads answered fast, for under $25,000 a month. Every photo view is a 100 KB image, and data out of the bucket costs $0.09 a GB — at this traffic that is most of the bill, about $22,000 a month, next to which the servers are small change. A CDN in front of the bucket is allowed: its fetches from the bucket are free and it bills a little less per GB, but the sim has no distance, so it won't make anything faster here.

What it checks

  1. 1Predict the load on the app servers when clients fetch files straight from storage instead of through the app.
  2. 2Predict the response time when slow work moves off the request path onto a queue.