Redis is a high performance key / value store. It is a NoSQL database. It supports various types of values including scalar and complex data structures including list, set, sorted set and hashset. We can just serialize our (e.g. JSON or XML) and just push it to Redis.
In this post we are going to learn how we can setup Redis on a Windows machine. In some later posts, we should see how we can build some example applications using Redis.
The download links are available on the following page. As we will be running on windows, let’s download the Win64 version. As mentioned on the download page, this is not an official redis version but supported by MS Open Tech group.
This takes us to its GitHub repository. Since we are not planning to do any development, let’s just download the release version, available in compressed ZIP format.
Win64 Redis is xcopy deployable. We should be able to run it as we download it. Just make sure that you have unblocked the zip file.
Redis can be installed and run as a Windows Service using the following commands:
Although you can install multiple instances of Redis Server (both console & window service), but you can not listen on the same port. So if you cannot start another instance of the server just check the configuration or just specify a different port in the start-up argument when you install the service.
Redis Server can run as console application or windows service. Just run redis-server executable from the download folder. It should launch the console as follows:
It can also be run as a Windows Service. There can be multiple instances of the server on the same machine. They can have different names and configured with requests on different ports. The complete documentation for running Redis server as a windows service is available in the download folder.
You can use the following commands to install, uninstall, start and stop the service.
In order to verify that redis server is successfully running, we can just use any redis client. Let’s just use redis-cli available in the same download folder:
We can’t learn all redis commands in one blog psot but there is a very good interactive tutorial for learning redis commands.