Redis DB : A Brief Overview

What is Redis ?

Redis is an in-memory data structure store that is open source (BSD licensed) and used as a database, cache, message broker, and streaming engine. Redis offers data structures such as bitmaps, hyperloglogs, geographic indexes, streams, lists, hashes, and sorted sets with range queries.

Redis offers various levels of on-disk persistence, transactions, built-in replication, Lua scripting, LRU eviction, high availability with Redis Sentinel, and automated partitioning via Redis Cluster.

On these kinds, you may do atomic operations like appending to a string, increasing a hash value, adding a component to a list, computing set intersection, union, and difference, or finding the set member with the highest ranking.

How does Redis work?

Redis uses an in-memory dataset in order to deliver the best speed. Depending on your use case, Redis can either regularly dump the dataset to disc or append each command to a disk-based log in order to preserve your data. If all you want is a feature-rich, networked, in-memory cache, you may easily turn off persistence.

Advantages of Redis :

  • Performance

    Redis’s memory-based design allows for low latency and high throughput data access. In-memory data storage, as opposed to conventional databases, doesn’t require a trip to the disc, cutting engine latency to microseconds. In-memory data storage can handle orders of magnitude more operations as a result, and they can also react more quickly. As a result, operations like reading and writing often take less than a millisecond, and millions of operations can be supported each second.

  • Modular data structures

    Redis provides a wide range of data structures to satisfy your application demands, unlike other key-value data stores that only offer a small selection. Data types in Redis include:

    • Strings – 512MB of text or binary data maximum
    • Lists – a group of Strings organized according to their addition order
    • Sets – an unsorted group of strings that may be used to intersect, unionize, and compare other Set types
    • Sorted Sets – Sets arranged in value order
    • Hashes – a data structure that stores a list of attributes and their associated values
    • Bitmaps – a data type that supports operations at the bit level
    • HyperLogLogs – an estimation of the unique elements in a data collection using a probabilistic data structure
    • Streams – a data structure for logs Inbox queue
    • Geospatial – a Maps “nearby” entry based on longitude and latitude
    • JSON – a named value object that supports integers, texts, Booleans, arrays, and other objects in a hierarchical, semi-structured fashion.
  • Simplicity and Usability

    Redis makes it possible to write typically difficult code in smaller, more concise chunks. Redis enables you to use less code in your applications to store, read, and use data. The distinction is that Redis allows developers to utilize a straightforward command structure as opposed to the complex query languages of conventional databases. One line of code, for instance, can transfer data to a data store using the Redis hash data structure. Many lines of code would be needed to do a comparable action on a data store without hash data structures in order to convert between one format and another. Redis offers several methods for manipulating and interacting with your data, as well as native data structures. For Redis developers, there are more than a hundred open source clients available. Java, Python, PHP, C, C++, C#, JavaScript, Node.js, Ruby, R, Go, and many other languages are supported.

  • Scalability and high availability

    Redis provides a single node main or clustered topology for its primary-replica architecture. This enables you to develop extremely reliable systems with constant performance. Numerous choices to scale up, scale in, or scale-out is furthermore accessible when you need to modify the size of your cluster. This enables your cluster to expand in response to your needs.

  • Open Source Software

    Redis is an in-memory data structure store that is open source (BSD licensed), and used as a database, cache, and message broker. Strings, hashes,  lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, and geographic indexes with radius queries are just a few of the data structures that are supported

On Windows 10, how do I install Redis?

To install Redis on Windows 10 correctly, adhere to the directions given.

  1. Download .zip or .msi file

    Redis is not supported by Windows, however, Microsoft does provide it to Windows users.Download the.zip or.msi file from https://github.com/microsoftarchive/redis/releases.The MSI file is an installer and will perform this task automatically for you whereas the ZIP file will require you to manually set the environment variables.

  2. Take the ZIP file apart(Extract Here).

    Extracting the ZIP file into a new folder called “Redis” is the next step. You can choose the folder’s name, but it’s a good idea to stick to the rules.
    Once the ZIP file has been extracted, Redis files will appear.

How can we test if Redis is installed or Not?

First open the command prompt and type:

redis-cli ping
// PONG

If it will give PONG as output then it’s installed.

Now, for some testing, we are storing some value in Redis. like, given below in the image. But, before that to open Redis CLI tool use redis-cli command in the command prompt.

redis-cli

Now, to store value, we have to use key-value pair.

// here set keyword will save Karan value for key name
set name Karan

Now, get the from typing set keyword with key name.

// get value of name key
get name

So, here I’ve given a basic introduction to Redis DB, hope you will like it.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe

Select Categories