Two very different objects
A post is really two things. There is the metadata, a small record with author id, text, timestamp, and counters. And there is the media, large blobs like images and video.
These have different needs, so they live in different systems.
Metadata storage
- Post metadata goes in a database keyed by post id, often partitioned by post id or author.
- It is small, structured, and read constantly when building feeds.
- Feeds store only ids, then hydrate by fetching these records in batches.
Media storage
- Media goes in an object store designed for large immutable blobs.
- The metadata record holds a reference, a url or key, not the bytes.
- Media is served through a content delivery network so bytes come from a server near the user.
Why split them
Mixing tiny metadata and huge media in one store would make feed reads slow and storage costly. Separating them lets the feed read small records fast while media streams efficiently from the edge.
Key idea
Posts split into small metadata in a database and large media in an object store fronted by a CDN, so feeds read fast records while media streams from the edge.