How it works
The client uploads images or video to object storage, a service such as S3 that stores large files by key, through a controlled upload path such as a presigned URL valid for one object and a short time. Processing workers can scan, resize, or transcode (convert to other formats and bitrates) the files before a post references a ready media object. The post database retains metadata, ownership, and object keys; it does not carry large video bytes through every feed query. In an example page of 20 posts, 1 KB of metadata each comes to 20 KB; with a 5 MB video stored in each row, the same query would move 100 MB.
A CDN (content delivery network, a set of caches near readers) serves approved variants. The feed API returns media URLs or tokens alongside post metadata; the browser fetches the bytes separately. Private media requires an authorization-aware delivery strategy, such as short-lived signed access, rather than assuming a public CDN URL is safe. CloudFront signed URLs work this way. The cost is that each page needs freshly signed links, and a leaked link still works until it expires.
If upload succeeds but publishing fails, clean up the unreferenced object after a grace period; a temporary upload prefix with an S3 lifecycle expiry rule is one simple way. If processing is delayed, show an explicit pending state or postpone publication according to the product promise. Deleting a post must also make cached media inaccessible within the required revocation window.
A private video is deleted, but its old CDN URL still works. Which boundary failed?
The delivery path did not revoke access promptly enough. Invalidate or expire cached access, use short-lived authorized URLs where appropriate, and tie the media lifecycle to post visibility.
Use this as a guide for self review; written answers are not graded.Keep in mind
- Object storage holds bytes; post storage holds ownership and references.
- A CDN improves delivery, while privacy and cleanup still need explicit rules.