Imgur 00:00:01 The share link arrives before every picture size is ready A photographer uploads one enormous festival photo. Build an illustrative image-sharing service that can acknowledge the upload promptly without trusting whatever file happened to arrive. Separate the upload permission, stored object and public picture record. Size, type and who is asking. The application gives this authorized upload a short-lived destination with the permitted method and object identity. Straight to the private store. Verify the resulting object before recording the upload as complete. ID k3Pz9Qa, status processing, hash of the delete token. A clash means draw again. The link works now and shows a placeholder. The delete token is shown once. A successful transfer means bytes reached a destination. A shareable image also needs validated content, ownership and an appropriate visibility state. Put those decisions behind the service's own checks. 00:01:05 Decode once and publish the right derivatives The original file is private while a worker prepares thumbnails and display versions. A tiny compressed input can expand into a much larger decoded image. Estimate the decoded work before allocating it. It is hidden for 5 minutes, not removed. 4,032 times 3,024 equals 12.2 million pixels. Under the limit of 50 million. The processing policy retains the decoded image data and removes unneeded metadata, such as embedded location, from public derivatives. 160, 640 and 1,280 on the longest side, so 640 times 480 for the middle one. The record changes last, so nobody is sent to a missing file. Publish only completed derivatives under their intended identities. If a worker repeats the job, deterministic output names and an authoritative ready transition prevent duplicate work from turning into duplicate public records. 00:02:05 One picture becomes the front page of the internet The photographer's link suddenly appears on a busy forum. Most viewers request the same image. Measure both requests per second and bytes per second because the origin and the edge network can reach different limits. 10 views a second, like a popular old picture. Traffic rises to a thousand requests per second in the first illustrated surge. 1,000 is 100 times the usual 10: viral. A rise within one minute, and steeper than the minute before. 50,000 a second, 15 GB/s from the edges. Hundreds of edges cost a few store reads through the shield. Here fifty thousand requests per second correspond to fifteen gigabytes per second at the edges under the assumed image size. High hit rates and coalesced misses protect the origin only while cache keys and expiry behavior cooperate. 00:02:59 Identical bytes do not give two people the same ownership Two accounts upload the same image bytes. A content hash can help share physical storage while each account retains its own record, permissions and deletion history. Delete one record and predict what the other user sees. Record a refers to blob 9c1f. Another person, another record, the same blob. The second file is dropped. The first logical image is deleted while the second record still references the shared bytes. No reference is left. The blob gets a date 30 days ahead. If nobody came: checked once more, then removed. Reclaim underlying bytes only after the policy establishes that no authorized reference still needs them. Keep privacy and deletion semantics separate from the convenient fact that two files have identical contents. 00:03:51 A deletion has as many boundaries as the delivery path Now the owner removes a public picture. Change the authoritative record, stop serving future origin reads and request invalidation through the shared caches. Which copies can the service still control? Status blocked. The origin answers 451 from now on. The files are removed from the public store when no allowed record needs them. Purged by tag. An edge that asks now gets nothing. Purged by tag, then probed from several countries. They cannot be reached. Their copy lives at most an hour. An already downloaded browser copy can outlive server-side invalidation. State the actual promise: deny future authorized serving and clear caches under your control. Test the old URL from several cache layers to see where the change has reached.