Wednesday, May 4, 2011

Redis Pipelines and Transactions


Redis is a fantastic NoSql database. The main reason I really like Redis is that it allows you to do very  powerful things yet the data model is simple and intuitive. All this is backed by remarkable ease of use and solid performance.
Redis supports two nice features, pipelines and transactions, that have a direct impact on the way user commands are handled and on performance. While the two features are distinct, they do share some similarities and can actually be combined together.
In this blog post I would like to shed some light on how these features can be used separately and jointly, and to examine the potential impact each use case could have. I will be using Jedis as a client but first, the usual disclaimer that goes with this kind of post: the examples are intentionally simple and far from being scientifically accurate. You are welcome to experiment and adapt.