Course contentsShow
← Software Engineering
Lesson 974 of 1,93330. Caching StrategiesFree lesson

Cache-as-SoR (System of Record)

Use cache as the primary data store for ephemeral data like sessions, where durability requirements are lower than performance needs.

Cache-as-SoR (System of Record)

You'll learn: When and how to use a cache as the authoritative, primary data store instead of just a performance layer.

What Does Cache-as-SoR Mean?

In traditional caching, the cache is a secondary store—a performance optimization sitting in front of a "real" database. But sometimes, you can flip this model: the cache becomes the System of Record (SoR), meaning it's the primary, authoritative source of truth for certain data.

This works best for ephemeral data—information that doesn't need long-term durability. Think user sessions, shopping carts, real-time analytics counters, or temporary workflow state. Here, performance and speed matter far more than surviving a server restart.

Why Use Cache-as-SoR?

When data is inherently temporary, writing it to a durable database adds unnecessary latency and complexity. A cache like Redis or Memcached can deliver microsecond response times with simpler semantics. You accept that if the cache node crashes, that data vanishes—but for sessions or temporary tokens, that's often acceptable (users just re-login).

Analogy: A whiteboard during a brainstorming session is your "cache-as-SoR." Notes there are authoritative right now, but you don't expect them to survive someone erasing the board. For permanent records, you'd use a notebook (database).

Key Characteristics

  • Primary store: No backing database for this data type
  • Ephemeral by design: Accepts data loss on restart
  • Performance-first: Optimized for speed over durability
  • Use cases: Sessions, rate-limiting counters, temporary locks, leaderboards

Key Takeaway:
Cache-as-SoR treats the cache as the authoritative data store for ephemeral data where speed trumps durability, eliminating the need for a traditional database altogether.