Timeline Storage Requirements
What you'll learn: You'll understand the specialized storage needs of social media timelines, which differ dramatically from general-purpose databases.
Why Timelines Are Storage Outliers
A social media timeline (also called a feed) has unique storage characteristics that make it one of the most challenging data structures in distributed systems. Unlike a blog or e-commerce site, timelines are heavily read-optimized: users check their feed dozens of times per day, but post new content only occasionally. This creates a read-to-write ratio that can reach 100:1 or even 1000:1.
Core Storage Demands
Speed Over Everything
When a user opens their app, they expect their feed instantly—ideally under 200ms. This means timeline data must live in extremely fast storage, typically RAM-backed caches or SSDs, not traditional disk-based databases.
Pre-Computed Results
Since fanout-on-write (push model) pre-builds timelines, each user needs a dedicated storage location for their feed. For 1 billion users with 500 posts per timeline, that's 500 billion entries to store and serve quickly.
Time-Ordered Access Pattern
Timelines are always accessed chronologically (newest first). Storage must support efficient range queries by timestamp, not just key-value lookups.
Hot Data vs Cold Data
Only the most recent posts (last few days) are frequently accessed. Older timeline entries can move to slower, cheaper storage—a pattern called tiered storage.
Storage Technology Choices
Think of timeline storage like a restaurant's expediting station: frequently ordered items stay on the hot counter (Redis/Memcached), while the full menu lives in the kitchen database (Cassandra/MySQL). This hybrid approach balances speed and cost.
Key Takeaway: Social media timelines require fast, scalable, time-ordered storage optimized for extremely high read throughput, often using in-memory caches backed by distributed databases with data tiering strategies.