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 persistence (RDB, AOF), replication, cluster sharding.
  • Memcached. Pure cache; no persistence; multi-threaded; very simple.
  • Valkey. Open-source fork of Redis after the 2024 license change; AWS and Linux Foundation backed.
  • DragonflyDB. Redis-compatible multi-threaded engine optimised for modern hardware.
  • KeyDB. Redis fork with multi-threading.
  • SAP HANA, MemSQL/SingleStore. In-memory relational and HTAP systems.
  • Hazelcast, Apache Ignite. In-memory data grids for distributed compute.

Durability strategies

Most in-memory engines support some level of disk persistence to survive restarts:

  • Snapshots. Periodic point-in-time dumps to disk.
  • Append-only log. Every write recorded sequentially; replayed on startup.
  • Replication. Multiple replicas reduce the chance that all copies fail at once.
🔗

Subscribe to Sahil's Playbook

Clear thinking on product, engineering, and building at scale. No noise. One email when there's something worth sharing.
[email protected]
Subscribe
Mastodon