In-memory Database

An in-memory database keeps its primary dataset in RAM rather than on disk, trading capacity and durability tradeoffs for orders-of-magnitude lower read and write latency. In-memory engines back almost every cache, session store, leaderboard, rate limiter, and many real-time analytics systems.

Common engines

  • Redis. The dominant in-memory key-value store; rich data structures, optional…
Cache Stampede

A cache stampede (or thundering herd) is the failure mode where many concurrent requests for the same hot key all miss the cache at the same time, hit the origin simultaneously, and overwhelm it. Stampedes typically happen the instant a popular key expires, when a cache is cold-started, or when a downstream system briefly fails and recovers.

How it happens

Consider a homepage feed cached with…

TTL (Time To Live) is the duration for which a cached value, DNS record, or other transient piece of data remains valid. After the TTL expires, the entry is considered stale and either evicted, refreshed, or revalidated. TTL is one of the simplest knobs in cache design with outsized impact on hit rate and freshness.

How it appears in different systems

  • Caches: per-key TTL on Redis or…

Memcached is an open-source, high-performance, distributed in-memory key-value cache, originally designed to speed up dynamic web applications by reducing database load. It is one of the oldest and most widely deployed caching systems, often paired with relational databases for read-heavy workloads.

How it works

Memcached stores arbitrary string keys mapped to arbitrary byte values, with a…

Redis (Remote Dictionary Server) is an in-memory data store that holds its dataset in RAM for sub-millisecond access. Beyond simple key-value, Redis supports rich data structures including strings, hashes, lists, sets, sorted sets, streams, bitmaps, and HyperLogLog.

How it works

A Redis server accepts commands over a simple text protocol (RESP). Commands are executed single-threaded, which…

Page 1