Caching Strategies: Cache-Aside, Write-Through & Eviction

Caching is a classical systems technique that reduces access latency by retaining temporary replicas of data closer to the point of consumption. A typical deployment comprises a backing store (for example, a relational database) that maintains the authoritative copy and one or more cache layers that materialize frequently accessed subsets. Although caching shares certain characteristics with colocation and replication, it introduces its own spectrum of latency, consistency, and operational trade-offs. This note surveys the conceptual foundations of caching and examines the strategies that practitioners employ in production systems. ...

February 14, 2025 · 47 min · 9937 words · Svein Erik

Social Media Platform Architecture at Scale

Modern social media platforms serve billions of users with sub-second latency requirements while handling massive write throughput and complex relationship graphs. This article examines the systems architecture required to build an Instagram or Facebook-scale platform, analyzing the mathematical models, algorithmic optimizations, and distributed systems patterns that enable performance at scale. Building a social media platform that can scale to billions of users is one of the most challenging problems in distributed systems. Unlike e-commerce sites with predictable traffic patterns or enterprise applications with controlled user bases, social platforms face extreme challenges: viral content creates massive traffic spikes, the social graph creates complex data dependencies, and user expectations demand instant updates. When Kim Kardashian posts a photo, millions of users want to see it within seconds—the system must handle this gracefully while simultaneously serving billions of other requests. ...

October 8, 2023 · 30 min · 6219 words · Svein Erik