- What is Redis?
- Install Redis
- Get to know the cli
- Create simple C# console App using redis
- Keep learning
What is Redis?
Redis is what we like to call an in-memory database that offers ridicules read and write speed. But hold on, I know what a database are, here is the thing Redis is just not any kind of database it’s a non-relational database, that stores its data sets with keys. Meaning that this type of databases goes in the NoSQL basket of databases. Since we no longer have tables and relations we have to manage our data somehow Redis takes care of this by using data structures, as of this writing Redis supports strings, sets, lists, hashes and sorted sets.
We are going to be using Linux, windows and mac have a slightly different procedure but this guide can help getting started. First let’s move to the correct directory.
Now let’s fetch the latest stable code from redis.io
Let’s uncompress that tar
Now let’s go ahead and compile the source code
Now lets make a symbolic link that points /usr/local/redis to /usr/local/redis-2.8.3
Let’s configure the terminal
Now let’s create the location of the actual database
Now let’s set the configuration for Redis
Getting to know the cli
testing the cli
Make sure everything is working properly
Cache itemsSet the item
Get the item
Exiting the cli
Create simple C# console application using redis
By far one of the most popular clients to interact with Redis using C# is ServiceStack.Redis, also the code base is always getting updated on their GitHub page.
Getting this to work on a Linux box can be a bit tricky start by adding nuggets to your mono develop then configure it with the proper Nuggets add inCertificates for nuggets Now just add in the package from servicestack.redis and let’s start coding
If this database is going into production I would like to send you over to Redis.IO for best practice
If Redis is your first NOSQL database, then I would suggest going over to try redis to get used to some of the commands