Overview:
- What is Redis?
- Install Redis
- Get to know the cli
- Create simple C# console App using redis
- Production
- Keep learning
d
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.
Install redis
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
Starting
Stopping
Version
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
Production
If this database is going into production I would like to send you over to Redis.IO for best practice
Keep learning
If Redis is your first NOSQL database, then I would suggest going over to try redis to get used to some of the commands
I always had a passion for the field of STEM (Science, Technology, Engineering, and Math) and I knew I wanted to do something to make a difference in the world. I just didn’t know where to start. I was an immigrant in a new country, grew up in a tough environment, and wasn’t sure how… Read More