8 March 2013
BookSleeve is a rather nice C# redis library that provides easy access to all of the standard redis functions. Because it aims to have an almost one-to-one mapping with the available redis commands it does not contain any higher-level functionality and therefore, if you wish to store an object, you must serialise it manually.
To simplify this process in our own projects we produced BookStack which is a small library that sits alongside BookSleeve and provides a few object-specific extension functions.
We make extensive use of ServiceStack in some of our applications and therefore the ServiceStack.Redis client should have been the obvious choice, however there are problems in its implementation of the asynchronous pub/sub features that made parts of our code feel somewhat messy:
The first problem is more of a quirk in that ServiceStack.Redis does not allow you to unsubscribe from a channel asynchronously, you must do it from within the message handler. This means you have to publish a message to allow it to disconnect.
When attempting to make one of our applications more resilient to networking failures we discovered that ServiceStack.Redis was not detecting and notifying it of broken connections.
On the other hand, BookSleeve supports asynchronous unsubscription and throws an exception when the connection is broken.
Primarily BookStack helps to store objects and maintain a set of IDs for each type which makes it simple to query for all objects of a given type.
It also provides helpers for storing lists of objects and a utility function for incremental ID generation.
Full details about BookStack including documentation can be found on github.