Redis 8 reduced per-command latency by 5.4% to 87.4% across 90 commands, through algorithmic improvements, not threading. Seventeen years after the first commit, the design is still being optimised within its own constraints rather than abandoned.
The Principle
Contention is not a problem you solve with more threads. It is a problem you design out.
Sanfilippo looked at the bottleneck in a memory-first system and identified it correctly: not computation, but coordination. He removed the coordination by making it impossible. The result was a system that processes millions of commands per second on a single core and delivers sub-millisecond latency under load.
The engineering instinct is to add parallelism when performance matters. Redis demonstrates that the opposite instinct (removing the overhead of coordination) can be more effective. The constraint is not a limitation to be overcome. It is the source of the guarantee.
Every application that has ever cached a session token, enforced a rate limit, maintained a leaderboard, or coordinated a distributed lock has relied on the fact that Redis will not corrupt its own data structures under concurrent access, because concurrent access of command execution is, by design, impossible.
The limitation is the architecture. The architecture is the feature.
Read the full article on vivianvoss.net →
By Vivian Voss — System Architect & Software Developer. Follow me on LinkedIn for daily technical writing.