Getting started with ServiceStack.Redis
Redis is a powerful tool with performance as its main focus. In this recipe, we will look at how to use different aspects of the ServiceStack.Redis client to help take full advantage of integrating with Redis.
Getting ready
Let's use Redis to enhance GreetingService
. We'll store each greeting created in the Redis cache. We'll need Redis installed and running in order to store and retrieve values, which we can do by performing the following steps:
Download the Redis
.zip
file from the Redis site at http://redis.io/download.For this example, it is easiest to run the Redis server on Windows. Although Windows is not officially supported, MSOpenTech on GitHub does maintain a repository for Redis on Windows. This can be found at https://github.com/MSOpenTech/redis/. At the time of writing, a zip of the latest can be found in
/bin/release
of the repository.Extract the
.zip
file.Start the
redis-server.exe
binary, as follows:After Redis is running, we'll also...