Redis - Stands for ‘Remote Dictionary Server’ it is an in-memory data structure project it implements a distributed, in-memory key-value database with optional durability. Redis’s developer is Salvatore Sanfilippo who was trying to improve the scalability of the startup.
Written in ANSI C.
May 10, 2009
6.0.9 / October 26, 2020
Redis supports different kinds of abstract data structures, such as:
It's a fast, open-source in-memory key-value data store for use as a :
Redis delivers sub-millisecond response times enabling millions of requests per second for real-time applications:
Redis data resides in memory. The best thing I feel about ‘Redis’ from what I have learned is that it eliminates the need to access disks. Again, in contrast to databases that store data on disk or SSDs, as said before ‘Redis’ is in-memory.
Redis and Memcached are in-memory, open-source data stores. Memcached is a high-performance distributed memory cache service, it's designed for simplicity and Redis offers a set of features that makes it more effective for a wide range of use cases.
It works in relational or key-value databases to improve performance, such as:
Most operations require a roundtrip to the disk compared to conventional disk-based, in-memory data stores, just like Redis, and it doesn't receive the same penalty.
Therefore, operations have faster response times to and from. The results are really quick on performance with the average read or write operations. It takes less than a millisecond and supports millions of operations per second.
Redis has a variety of data structures to meet application needs, not like simplistic key-value data stores which will offer limited data structures.
Redis simplifies the codes enabling it to write fewer lines of code to the store access, it will use the data in your application/s. If your application has data stored in a *hashmap (*An instance of HashMap has two parameters that affect its performance: initially capacity and the load factor. https://en.wikipedia.org/wiki/Hash_table), you will want to store that data in a data store. You can then simply use the Redis hash data structure to store the data.
Another task on the datastore with no 'hash' data structure would need many more lines of code just to convert it from one format to another format. Redis comes with a local or endemic data structure and many options to manipulate and interact with your data.
Redis employs a primary-replica architecture and it supports asynchronous replication where the data can be replicated if needed to multiple replica servers. This will provide an improved read performance on requests and faster recovery when the primary server experiences any downtime. Redis requests can be split among the servers. So for persistence, Redis supports point-in-time backups, which just basically copies the Redis data set to disk.
Redis has a primary-replica architecture in a single primary node or a clustered topology. This will allow you to build highly available solutions while providing consistent performance and reliability. When needed to adjust your cluster size, many options are also available to scale up and scale in or out. This will also allow your cluster to grow with more demands.
Redis is an open-source project just like Magento and it’s supported by a lively community. No vendors or technology locks, as Redis is open standards-based, it supports open data formats and features with a great set of clients.
Redis is a great choice when choosing a highly available ‘in-memory cache’ to decrease data access latency, that increases through output, it eases the load off NoSQL database and /or application/s.
Caching frequently used objects such as images, files, and metadata are all popular examples of caching with Redis.
Redis supports Pub/Sub and pattern matching plus a variety of data structures such as:
This allows Redis to support high-performance for:
The Redis list data structure makes it easier to implement a lightweight queue. Lists offer operations with blocking capabilities, making them suitable for a variety of applications that need a reliable message broker.
Redis is a popular choice among game developers looking to build real-time leaderboards. They simply use the Redis 'Sorted Set' data structure, this provides unique elements while maintaining the list sorted by users' scores. Real-time rank lists are as easy as updating a user's score for each time it changes. Sorted Sets can also be used to handle time-series data by using timestamps for the score.
Offers in-memory data store to power live streaming use cases. It can be used to store metadata about users' profiles plus viewing histories, and authentication information for millions of users, the manifest files to enable CDNs to stream videos to millions of mobile and desktop users at a time.
Redis offers purpose-built in-memory data structures and operators to manage real-time geospatial data at scale and speed.
Commands such as:
Plus the real-time analysis of ‘geospatial data’ makes geospatial easy and fast to a store.
Modern data-driven applications do require machine learning to process a massive volume, variety, and velocity of data quickly. Use cases include fraud detection in gaming and financial services, real-time bidding in ad-tech, and matchmaking in dating, and the ability to process live data to make decisions within tens of milliseconds is very important. Redis provides a fast in-memory data store to build, train, and deploy machine learning models fast.
It can handle streaming solutions such as:
It is used as an in-memory data store to ingest, process, and analyze real-time data with sub-millisecond latency. Redis becomes the ideal choice for real-time analytics use cases such as:
External modules are used to extend Redis functionality. Adding new Redis commands with features that are similar to what can be done to the core itself.
These Redis modules are dynamic libraries, which can be loaded at Redis startup or using the ‘MODULE LOAD’ command. Modules are supposed to be written in C, it will however be possible to use C++ or other languages that have C binding functionalities.
*Redis Modules https://redis.io/modules
Download and extract Redis:
$ tar xzf redis-6.0.9.tar.gz
$ cd redis-6.0.9
The binaries that are compiled are now available in the src directory.
You Run Redis with:
You can use the Redis built-in client:
redis> set foo bar
redis> get foo