Book Review: Redis Essentials
It serves well as an introduction to the Redis system and ecology, showing readers step by step how they might utilize a Redis object storage server in practical terms. It starts out with some explanation of how to install the Redis system, a little bit of background on the Redis system, but quickly dives into what makes the Redis system tick.
For more information on the book and to purchase it directly from amazon, click the image to the left.
Redis is an object storage server. It is a bit like a database, except that it makes a point of utilizing memory efficient data types and storing all the information in active memory. Imagine if you stored a giant dictionary, or basically an associative array, in memory and then meted out an API to access that dictionary. That’s Redis in a nutshell. ‘Records’ are just keys to any given data. You are responsible for organizing your keys in any way you see fit.
So say I decide I’m going to store a set of data at key ‘asher’. If I talk to the Redis server and tell it to look up ‘asher’ it’ll give me the data I stored. There’s no cross-referencing, no SQL statements, no ‘joins’. It’s just keys and data. The power comes from its speed and availability to work in concurrent environments. The Redis commands are ‘atomic’ meaning, they won’t get confused when you write and read from various keys at different points. Redis imposes very little organization in terms of how its to be used, though there are community best practices. These are covered briefly in the book, but are definitely worth noting. It would’ve been interesting to see a chapter devoted to the best practices of the community.
It immediately introduces the data types that are used frequently in the Redis server and quickly provides code examples utilizing those data types. It covers interacting with the Redis server first on the command line directly, which facilitates understanding of how a client in Node.js interacts with the server. Covered data type include strings, hashes, sets, and hyperloglogs. It quickly covers the implementations and uses them in useful examples.
I was particularly interested in the set data type, seeing as how it mirrors an abstract data type I programmed for the PHP asherwunk/phabstractic library. You can see more information about the set data type I programmed here. In Redis I don’t believe you can have multiple entries of similar data in the same set. The fact that something like the set is one of the native data types of Redis is what provides much of its power and flexibility.
This book is not a reference manual detailing everything there is to know about Redis, but otherwise does what it’s title promises, and provides the essentials that must be known to get up and running with something useful on the Redis server. All of the examples in the book are given in Node.js, though there is a chapter on how to interface with Redis using your favorite scripting language such as Ruby, Python, or PHP.
This book is rather short, clocking in at only about 200 pages. There are chapters devoted to security, and to ‘clustering’ or basically distributing or having a fail-safe installation of Redis, but everything is focused directly on ease of use and immediate applicability. I appreciated that it had a chapter on common pitfalls to avoid, things that could cause huge headaches down the road when you’re dealing with the eventual mass of data in your storage.
One short-coming I found was the very terse or brief coverage of publisher/subscriber functionality in Redis. As I’ve been able to ascertain from the web and other sources, this functionality is one of the prime reasons people use Redis. Basically, with the publisher/subscriber channel functionality, Redis provides a way to communicate between multiple processes and clients via the server. Essentially, somebody broadcasts or publishes to a channel, and everyone listening on that channel with the server gets notified. With the ability to store data as strings and sets via keys, this proves to be very useful in sharing quick and easily serialize-able data between processes. I walked away from this book with what I felt was a very rudimentary understanding of how best to use the channels functionality and how best to implement publishers/subscribers in Redis.
Besides this failing however, I believe this book does a fabulous job of getting anyone with a background in programming up and running with Redis in as short a time as possible. But there’s the catch, it assumes you have a background in programming and that you are proficient at the types of things that Redis is used for. There is very little theory about Redis covered here. It would’ve been interesting to learn a bit more about the history, and also about the configuration options of Redis more thoroughly, but for a book touting ‘essentials’ it provides.
This is part of a list of Books Asher’s Read
If you appreciated this book review please consider supporting me on Patreon.
If a monthly commitment is not your thing, you might consider buying me a coffee.