Ten Redis Techniques That Go Way Beyond Caching
These patterns let a team replace heavier infrastructure with Redis alone: a Bloom filter stops cache stampedes, Redisson handles lock renewal safely, and HyperLogLog cuts UV tracking memory from gigabytes to kilobytes. That means lower operating cost and simpler ops, but also forces a judgment call on whether the added client dependencies and approximate results fit the system's consistency requirements.
Redis is commonly seen as a cache, but it ships with data structures and modules that solve distributed system problems directly. This roundup walks through ten of them, starting with a Bloom filter for cache penetration protection, which fits about 100 million elements in 100MB with a configurable false-positive rate. Redisson's distributed lock improves on raw SET NX with Lua-based atomicity and an automatic renewal watchdog, while its delayed queue leverages Sorted Sets for precise scheduling, like auto-canceling unpaid orders after 30 minutes.
Further entries cover a Lua-driven token bucket for rate limiting, bitmaps that compress daily check-in and online status tracking to pennies of memory, and HyperLogLog's fixed 12KB structure for cardinality estimates within 0.81% error. GEO support (Redis 3.2+) enables radius searches and distance calculations, and the Stream type (Redis 5.0) brings consumer groups, acknowledgments, and replay as a lightweight MQ. Lua scripts give atomic multi-command guarantees, and the RedisJSON module stores and manipulates JSON documents directly.
Each technique includes a code sample and explicit pros, cons, and use cases. The author stresses that Redis remains an in-memory database, so memory cost and persistence strategies still matter for large data sets, and several features lean on the Redisson client, which adds a dependency worth evaluating.
Most of the advanced features in this list depend on the Redisson client, which bundles lock, queue, and stream abstractions; that convenience comes with a heavier dependency and an implicit trust in Redisson's implementation choices.
The article treats approximate data structures (Bloom filter, HyperLogLog) as acceptable trade-offs for high-concurrency systems, a stance that works only when the use case tolerates false positives or small cardinality errors.
The summary table suggests these features are drop-in replacements for dedicated services like message queues or spatial databases, but failure handling and operational semantics remain on the developer to build.
The emphasis on memory cost is a reminder that Redis's power comes with a price: every advanced structure still lives in RAM, so the real engineering problem is deciding which data genuinely needs in-memory speed versus which can be pushed to disk.