Why Redis Is Fast
In-memory data, focused primitives, and event-loop simplicity.
Infrastructure1 minInspired by Redis design notes
Memory first
Redis keeps the active data set in RAM, removing disk latency from the hot path.
Event loop
A mostly single-threaded execution model avoids lock contention for core operations.
tsx1while (true) {2 const events = waitForSockets();3 for (const event of events) executeCommand(event);4}
Tradeoffs
Heavy commands can block progress, memory is finite, and persistence/replication choices affect behavior under failure.