In-Memory Databases

Durability strategies

ApproachExampleUse caseTrade-off
No durabilityMemcachedCaching onlyData lost on restart — and that's acceptable
Disk loggingVoltDB, RAMCloudPersistent storageAppend-only log for recovery
Periodic snapshotsRedis (basic)Persistent storagePeriodic state snapshots to disk
ReplicationCouchbasePersistent storageIn-memory state replicated to other machines
HardwareOracle TimesTenPersistent storageBattery-backed RAM — expensive

The product landscape

Relational

VoltDB (SQL-based, writes to disk periodically), SingleStore, Oracle TimesTen.

Key-value

Durable: RAMCloud (log-structured). Weak durability: Redis, Couchbase (async disk writes).

Secondary advantages

  • Operational benefits of disk writes even when disk isn't the primary store: easy backups, external inspection and analysis tooling, audit trails.
  • Simplified implementations. Complex data structures — priority queues, sorted sets — are far easier to implement when everything is in memory. Redis's simple-but-powerful API is a direct consequence.

The organizing principle: disk is used as an append-only log for durability, not as primary storage. All reads are served from memory. Replication and snapshots enable recovery without special hardware.

The Invariants

  • Guarantees: Read latency bounded by RAM access and by never paying serialization cost, plus data structures that would be impractical on a page-oriented layout.
  • Does not guarantee: Durability — that is a per-product configuration choice ranging from "none" (Memcached) to battery-backed RAM, and the default is usually weaker than people assume.