An in-memory database keeps the working set in RAM, so reads and writes avoid disk I/O.
Traditional databases read/write from disk (even SSD, ~100 µs–1 ms). An IMDB keeps data in RAM (~100 ns), gaining 1000x latency improvement. The trade-off: RAM is volatile and expensive. Persistence is added via write-ahead logs, snapshots, or replication — but you're always working with a cached copy of disk or a copy that could be lost.
Examples: Redis, Memcached, Hazelcast, VoltDB, SAP HANA, Aerospike, Dragonfly. Each optimizes for a different access pattern.