Getting Started with Redis

Amar Nath
2 min readFeb 7, 2022

--

In this article, we will briefly look into Redis works and how it can be installed in Linux-based machines.

Introduction:

Redis stands for Remote Dictionary Server. It is a fast, open-source, in-memory, key-value data store. All Redis data resides in memory, which enables low latency and high throughput data access. Unlike traditional databases, In-memory data stores don’t require a trip to disk, reducing engine latency to microseconds.

Redis is a great choice for implementing a highly available in-memory cache to decrease data access latency, increase throughput, and ease the load off your relational or NoSQL database and application. Redis can serve frequently requested items at sub-millisecond response times and enables you to easily scale for higher loads without growing the costlier backend.

Database query results caching, persistent session caching, web page caching and caching of frequently used objects such as images, files, and metadata are all popular examples of caching with Redis.

Installation (From source code) :

Create a folder where we will download and install Redis:

$ mkdir Redis_Tutorial
$ cd Redis_Tutorial

Download, extract and compile Redis with:

$ wget https://download.redis.io/releases/redis-6.2.6.tar.gz
$ tar xzf redis-6.2.6.tar.gz
$ cd redis-6.2.6
$ make

The binaries that are now compiled are available in the src directory. Run Redis with:

$ src/redis-server

We can interact with Redis using the built-in client:

$ src/redis-cli
redis> set foo bar
OK
redis> get foo
"bar"

We can use the set command to set the value for a key. In the above example, we are storing the value(bar) for key(foo).

We can use the get command to fetch the value of a key. In the above example, we are fetching the value(bar) for the key(foo)

References:

https://aws.amazon.com/redis/

https://redis.io/download

--

--