Redis - Matt Whipple

Site Nav

Redis seems fairly ubiquitous these days. It's a technology that I've worked with incidentally many times in the past but one which I haven't gotten around to paying particular attention to until now. Redis is a wonderfully powerful but simple tool, and that seems to invite somewhat of a level of underinformed adoption, specifically for caching.

Most often this seems to materialize as over-eager use of caching either as an incarnation of premature optimization, or to attempt to band-aid over more fundamental performance concerns. This is not to say that a Redis backed cache cannot provide significant performance benefits, but the value of any cache can largely be reduced to cache hits reducing load or time and if you don't have the metrics which support those benefits then the introduction of a cache may not be delivering anything more than higher costs and exciting new failure modes. I've not only seen cache key strategies for which hits seem highly unlikely, but also those that all but guarantee misses.

Another issue I've seen likely driven by perceived simplicity is one where the cache is abstracted without proper attention. Libraries which provide a higher level interface to caching may be making questionable lower level decisions such that the the convenience of not having to worry about certain aspects up front lead to cache management complications later. The offloading of decisions such as how objects are serialized and stored may impede working with the cache in other ways such as manipulating it manually or through another client, migrating to another strategy or library, or even upgrading the libraries currently in use. All of this can lead to complications and risks that could be easily avoided. There is certianly nothing wrong with going this route; this ultimately just circles back to the concept of proper attention. There are plenty of ways to avoid or work with any of these consequences it's simply a matter of communicating or planning before things catch fire.

As I'm currently working on a solution that makes use of Redis it seems about time to get up to speed on its finer points. To that end I'm currently reading Redis in Action[redis-in-action].


Author: mwhipple

Created: 2020-10-27 Tue 19:36