While the audience of our application is increasing rapidly, it requires more requests to the database. But each request to the database needs a sufficient amount of time. Sometimes we also need to pay more for the requests to the database. So we need to decrease the request to the database in possible situations. Redis is the solution for this.
What is Redis?
Redis is an open-source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports various data structures such as Strings, Hashes, Lists, Sets, etc.
In simple words, we can store the data from our database in our backend storage as a cache. Afterward, this data is served to our front-end for the same API request through a specific amount of time period.
Redis is made using ANSI C programing language and it uses NoSQL structure to store data which makes it more popular nowadays.
Currently, tech giants like GitHub, Weibo, Pinterest, Snapchat, Craigslist, Digg, StackOverflow, Flickr, etc. are using Redis. So we can trust Redis in using within our application.
Is Redis Compatible with Windows 10?
Redis is made for work with servers. POSIX systems like Linux, *BSD, OS X without external dependencies and is not compatible with Windows systems because Windows servers are not using widely.
But if we are developing an application using Redis on a Windows system, Running Redis in our system is necessary.
So here in this tutorial, we are going to explain the steps in running Redis on a Windows 10 system.
Install Ubuntu on Windows 10
We have already told that Redis is not developed to work within Windows systems because Windows servers not using widely. So it requires a Unix based operating system like Ubuntu, or macOS to run Redis server. macOS can only be installed on Windows 10 using Virtualbox and it’s most complicated. But Ubuntu can be easily installed within our Windows 10 operating system easily because it’s available in Microsoft store. We can simply install the LTS version of Ubuntu from Microsoft store using the link below.
Ubuntu is not mandatory to set up the Redis server. It supports other Linux versions such as Debian and Kali Linux. Use the below link to download it.
In this tutorial, we are going to set up a Redis server in Ubuntu operating system. Without using any URL’s above, we are manually downloading it from the Microsoft store.
1. Open Microsoft Store
First, open the Microsoft Store by searching “store” in the left-bottom Windows 10 search box.
2. Install Ubuntu
The Microsoft Store will be opened and now search for Ubuntu. In the top-right search box, search for Ubuntu and click on the latest version(18.04 LTS) from the suggestions and Get the app.
3. Launch Ubuntu
So the Ubuntu is installed on our Windows system and now we need to launch it. So search for “ubuntu” in the Windows search box.
An Ubuntu terminal will be opened and this terminal is used to set up Redis.
Install Redis on Ubuntu
So we have successfully set up an Ubuntu server inside our Windows operating system.
Now we can install Redis on this Ubuntu system by following the below steps.
1. Download Redis
To install Redis-server, we need to download the stable version of Redis from the official website. This can be done with the below command.
2. Extract and Make
Now extract the file we have downloaded using the below command.
tar xvzf redis-stable.tar.gz
Now, enter the directory we have created.
Now, execute the
make command. The purpose of the
make utility is to determine automatically which pieces of a large program need to be recompiled, and issue the commands to recompile them.
3. Start Redis server
After the successful installation Redis server, we can start the Redis server using the
The above commands start the Redis server on our system as shown in the below screenshot.
Now we can close the Ubuntu terminal window. This will not stop the Redis server we have started earlier.
But we have to note that, it needs to start Redis server after each system reboot by running
Have a nice code !