Redis Roadmap
This Redis Roadmap is a free, full-text syllabus of 162 lessons in 29 stages, starting with What is Redis? and ending with Redis Enterprise. It suits anyone who wants to learn Redis, whether new to it or filling gaps. There is no fixed length: every lesson is open from the start, so you go at your own pace and skip what you already know.
Last updated
Reading is open to everyone. Sign in to join this roadmap and track what you finish.
Continue learning
1. What is Redis?What is Redis?
0%What is Redis?
5 topics · 0 completed
The last 4 topics are drawn beside this stage on the original roadmap. Which stage they belong to is not recorded, so they are listed here rather than filed under one.
The diagram draws the same 162 lessons as a map, with lines showing the order. It needs JavaScript; the full syllabus below lists every lesson as text.
Full syllabus: every lesson in the Redis roadmap
29 stages and 162 lessons, in the order the roadmap suggests. Every lesson is free to read and open from the start.
Stage 1: What is Redis?
What is Redis?
Redis is an open-source, in-memory data structure store, primarily used as a database, cache, and message broker. It supports various data structures like strings, hashes, lists, sets, and sorted sets, making it highly versatile. Redis operates with extremely low latency due to its in-memory nature, enabling fast…
In-memory Data Structure Store
An in-memory database is a purpose-built database that relies primarily on internal memory for data storage. It enables minimal response times by eliminating the need to access standard disk drives (SSDs). In-memory databases are ideal for applications that require microsecond response times or have large spikes in…
Key-value Database
Key-value Database is a non-relational (NoSQL) database that stores data as a collection of key-value pairs. In this model, each piece of data is associated with a unique identifier (key) that is used to retrieve the corresponding value. This simple structure allows for high performance and scalability, making…
Cache
Redis cache is an in-memory key-value store used to cache frequently accessed data to improve application performance. By storing data in memory rather than on disk, Redis significantly reduces data access latency, making it ideal for use cases such as session management, caching database query results, and storing…
Message Broker
A message broker is a middleware system that enables communication between different services or applications by routing, storing, and delivering messages. Redis can serve as a lightweight message broker using its PUBLISH and SUBSCRIBE commands for a pub/sub messaging pattern, or through lists and sorted sets for…
Stage 2: Strings
Strings
Strings in Redis are binary-safe, meaning they can contain any kind of data, including text, integers, floats, or even binary data like images and they can hold up to 512 MB of data per key. Redis strings support a wide range of operations, from basic CRUD (Create, Read, Update, Delete) to more complex…
Redis vs SQL/NoSQL DBs
Redis differs significantly from traditional SQL and NoSQL databases in terms of data model, performance, and use cases. Redis is an in-memory key-value store that supports various data structures like strings, hashes, lists, and sets, allowing for flexible data handling and low-latency access. This makes it ideal…
When to choose Redis?
Redis is ideal when you need a fast, in-memory data store with low latency and high throughput. It's particularly well-suited for caching, session management, real-time analytics, leaderboards, and message queues.
Caching
Redis cache is an in-memory key-value store used to cache frequently accessed data to improve application performance. By storing data in memory rather than on disk, Redis significantly reduces data access latency, making it ideal for use cases such as session management, caching database query results, and storing…
Real-time Analytics
Real-time analytics in Redis involves the immediate processing and analysis of data as it is generated or received, enabling businesses and applications to gain insights and make decisions on-the-fly. Redis's in-memory data storage architecture allows for extremely low-latency access to data, making it ideal for…
Session Management
Redis session management leverages the database's speed and versatility for efficient web application user session handling by using key-value storage with session IDs as keys, allowing quick access and updates.
Pub/Sub Messaging
Pub/Sub messaging in Redis is a messaging pattern that allows clients to communicate with each other through channels without needing direct connections. In this model, clients can subscribe to one or more channels to receive messages and can publish messages to these channels. When a message is published, all…
Leaderboards and Counters
Leaderboards and counters are common use cases for Redis, leveraging its sorted sets and atomic increment operations. For leaderboards, the ZADD command is used to add members with their scores to a sorted set, and ZRANGE or ZREVRANGE retrieves the top (or bottom) ranked members efficiently. This makes Redis ideal…
Starting the Server
Starting a Redis server is platform dependent and is usually done via systemctl on Linux or brew services on MacOS.
Connecting using Redis CLI
The Redis CLI (redis-cli) is a command-line interface used to interact with a Redis server. It allows users to run Redis commands, monitor the server, manage data, and perform administrative tasks. Common operations include setting and getting keys, managing key expiration, and checking server status. The CLI…
Basic Commands / SET, GET
In Redis, the SET and GET commands are fundamental operations used to store and retrieve key-value pairs. Redis is an in-memory key-value store, and these commands form the basis for working with data in Redis.
Using Package Managers
Redis can be installed on Linux, MacOS and WSL2 via the platform specific package managers such as yum, apt and brew.
Pre-compiled Binaries
Redis can be compiled and installed on a variety of platforms and operating systems including Linux and macOS. The Redis binaries have no dependencies other than a C compiler and libc.
Using Docker
Redis Community Edition can be installed on Docker but it is recommended to complete the installation of Redis Stack in order to gain access to the modeling capabilities, be able to search and query data, as well as using Redis as a vector database.
Data Persistence Options
Redis offers two main data persistence options: RDB (Redis Database) snapshots and AOF (Append-Only File). RDB creates point-in-time snapshots of the dataset at specified intervals, making it suitable for infrequent backups but with potential data loss between snapshots. AOF logs every write operation and replays…
Rich Data Structures
Redis provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams.
High Performance and Scalability
High performance and scalability in Redis are achieved through its in-memory data storage model, which allows for extremely fast read and write operations with minimal latency. Redis supports data partitioning, replication, and clustering, enabling it to scale horizontally across multiple nodes and handle large…
Setting and Getting Keys
In Redis, setting keys refers to the operation of storing keys by associating them with unique identifiers (keys), it's the process of writing or updating data in the systems. Getting keys refers to the process of retrieving data from the system using the associated key.
DEL
The DEL command in Redis is used to delete one or more keys from the database. If the specified key(s) exist, they are removed, and the command returns the number of keys that were deleted. If a key does not exist, it is simply ignored, and no error is returned. This command is useful for managing memory by…
expire
The EXPIRE command is used to set a time-to-live (TTL) for a key in seconds, after which the key will be automatically deleted. If you need to specify the expiration time in milliseconds, you can use the PEXPIRE command. Both commands help manage memory by allowing you to automatically remove keys that are no…
TTL
The TTL command returns the remaining time left to live of a key that is specified, this capability allows a Redis client to check how many seconds a given key will continue to be a part of a dataset.
Overview of Data Types
Redis is a data structure server and at its core, REdis provides a collection of native data types that allow you to solve a wide variety of problems, from caching to event processing.
HSET
HSET is a Redis command used to set the value of a specified field within a hash. If the field already exists, it updates the value; if not, it adds the field to the hash. This command is useful for creating and managing key-value pairs within a hash structure without modifying other fields. It returns 1 if a new…
HGET
HGET is a Redis command used to retrieve the value of a specified field within a hash. If the field exists, it returns the value; if not, it returns nil. This command is efficient for accessing specific fields within a hash without retrieving the entire hash structure, making it ideal for scenarios where only…
HGETALL
HGETALL is a Redis command that retrieves all the fields and their values from a specified hash. It returns the data as an array of field-value pairs, making it useful for obtaining a complete view of the hash's contents. However, it can be memory-intensive for large hashes, so it’s recommended to use it cautiously…
HDEL
HDEL is a Redis command used to delete one or more specified fields from a hash. If the fields exist in the hash, they are removed, and the command returns the number of fields that were deleted. If a specified field does not exist, it is ignored. HDEL is useful for efficiently managing memory and cleaning up data…
HEXISTS
HEXISTS is a Redis command used to check if a specified field exists within a hash. It returns 1 if the field is present and 0 if it is not. This command is useful for verifying the presence of specific fields in a hash before performing operations like updates or deletions. It helps ensure data consistency and…
More Commands
Redis Hashes include operations like HMSET and HMGET to set or retrieve multiple fields and values at once, HINCRBY and HINCRBYFLOAT to increment the value of a field by a given integer or float, and HLEN to get the number of fields in a hash. Commands like HKEYS and HVALS are used to retrieve all field names or…
SET
The SET command sets the defined key to hold a value, if the key already holds a value then it will be overwritten regardless of its type.
GET
The GET command in Redis is used to retrieve the value associated with a specified key. If the key exists, it returns the value as a string; if the key does not exist, it returns a nil response. This command is fundamental for accessing stored data in Redis and is often used in conjunction with other commands to…
INCR
INCR command used to increment the value of a string key by 1. If the key does not exist, it initializes the key with a value of 0 before performing the increment operation, resulting in a value of 1. If the key contains a non-integer value, the command will return an error. INCR is atomic, meaning it is safe to…
DECR
The DECR command in Redis decreases the integer value of a key by 1. If the key does not exist, it is initialized to 0 before performing the decrement. If the key contains a value that is not an integer, Redis returns an error. This command is useful in counters and for tracking state changes in a simple, atomic way.
APPEND
Redis APPEND command is used to add some value in a key. If the key already exists and is a string, this command appends the value at the end of the string. If key does not exist it is created and set as an empty string,
STRLEN
The STRLEN command returns the length of a string value that is stored at the defined key, if no string value is help at the key then an error will be returned.
More Commands
Redis strings include a variety of operations that go beyond basic SET and GET functionality. Examples include MSET and MGET for setting and getting multiple keys at once, GETSET to set a new value while returning the old one, and SETEX or PSETEX for setting a value with an expiration time. Other commands like…
Stage 3: Hashes
Hashes
Hashes in Redis are a data type that allows you to store a collection of key-value pairs under a single key, similar to a dictionary or a map. Each hash can hold multiple fields, and each field has its own value, making hashes ideal for representing objects or entities with various attributes. You can perform…
Stage 4: Sorted Sets
Sorted Sets
A sorted set in Redis is a collection of unique strings, or members, that are ordered by an associated score. When more than one string has the same score, the strings are ordered lexicographically.
Usecases
Usecases
Stage 5: Lists
Lists
Lists in Redis are ordered collections of string elements, allowing operations such as pushing, popping, and accessing elements by index. Lists support various commands, like LPUSH and RPUSH to add elements to the beginning or end, LPOP and RPOP to remove elements, and LRANGE to retrieve a range of elements. They…
Stage 6: Sets
Sets
A Redis set is an unordered collection of members which can be used to track unique items, represent relations and perform set operations.
Stage 7: Atomicity in Redis
Atomicity in Redis
Atomicity in Redis refers to the property that ensures a set of operations is executed as a single, indivisible unit. This means that either all the operations are executed successfully or none of them are. Atomicity is crucial in Redis to maintain consistency, especially when multiple operations need to be…
ZADD
The ZADD command adds all of the specified members with the specified scores to the sorted set defined at key.
ZRANGE
The ZRANGE command can perform multiple range queries including by rank, by score or by lexiographical order. The order of elements returned are always from lowest to highest and any score ties are resolved using reverse lexiographical ordering.
ZRANK
ZRANK returns the rank of member in the sorted set stored at key, with the scores ordered from low to high. The rank is 0-based, which means that the member with the lowest score has rank 0. The optional WITHSCORE argument supplements the command's reply with the score of the element returned.
ZREM
Removes the specified members from the sorted set stored at key. Non existing members are ignored. An error is returned when key exists and does not hold a sorted set.
ZRANGEBYSCORE
This command retrieves elements from a sorted set stored at the specified key. It returns all elements with scores falling within the given min and max range, inclusive of both boundaries. Elements are ordered from lowest to highest score. For elements sharing the same score, the command returns them in…
ZINCRBY
ZINCRBY increments the score of a member in a sorted set by the defined increment. If the member targeted does not exists in the sorted set then it will be added and will be assigned the value of the increment. If the key does not exists that ZINCRBY will created the set with the targeted member as it's only member.
ZCOUNT
ZCOUNT returns the number of elements in the sorted set at the targeted key, with a score between min and max.
More Commands
Redis Sorted Sets include operations like ZREVRANGE to get elements in reverse order, ZRANGEBYLEX to retrieve elements within a specific lexicographical range, and ZINTERSTORE or ZUNIONSTORE to perform intersection and union operations on multiple sorted sets and store the results. Commands like ZREMrangeBYRANK and…
LPUSH
LPUSH is a Redis command that inserts one or more elements at the beginning (left side) of a list. If the list does not exist, it creates a new list before performing the insertion. This command returns the length of the list after the operation. LPUSH is useful for building stacks or adding items to queues where…
RPUSH
The RPUSH command will insert all the specified values at the tail end o the list that is stored at the defined key, if the key does not exist then it will be created as an empty list before performing the push.
LPOP
LPOP is a Redis command that removes and returns the first element from the left side of a list. If the list is empty or does not exist, it returns nil. This command is commonly used in scenarios like implementing queues or consuming elements in FIFO (First-In-First-Out) order, making it ideal for task processing,…
RPOP
The RPOP command removes and then returns the last elements of the list stored and the specified key, by default it will pop only a single element from the list.
LRANGE
LRANGE is a Redis command that retrieves a specified range of elements from a list, defined by a start and stop index. The indices can be positive (starting from 0) or negative (e.g., -1 for the last element). This command is commonly used to fetch subsets of a list without loading the entire list into memory,…
LINDEX
LINDEX is a Redis command used to retrieve an element from a list by its index. The index can be positive (starting from 0 for the first element) or negative (e.g., -1 for the last element). If the index is out of range, the command returns nil. This command is useful for accessing specific elements in a list…
LLEN
LLEN is a Redis command used to return the length of a list stored at a specified key. If the list does not exist, it returns 0. This command is efficient for quickly checking the number of elements in a list without retrieving its contents, making it useful for monitoring queue sizes, tracking list growth, or…
LMOVE
LMOVE is a Redis command used to atomically move an element from one list to another. It pops an element from the source list (either from the left or right end) and pushes it to the destination list (either to the left or right end), based on the specified parameters (LEFT or RIGHT). This command is useful for…
More Commands
Redis Lists include operations like LTRIM to trim the list to a specified range, RPOPLPUSH to remove an element from one list and append it to another, and BLPOP or BRPOP for blocking pop operations that wait until an element is available. Commands like LPOS allow finding the position of elements, and LSET is used…
SADD
The SADD command will add the specified members to the set which is stored and the defined key, any specified members that are already a member of the set will simply be ignored.
SREM
The SREM command will remove the specified members from the set stored at the defined key, specified members that are not a member of the set will be ignored.
SMEMBERS
The SMEMBERS command returns all the members of the set that is defined at key.
SISMEMBER
The SISMEMBER command will simply return a boolean value is the members is a part of the set stored at key.
SINTER
The SINTER command will return members of the set which will result in the intersection of all the given sets, keys that do not exist are considered to be empty sets.
SCARD
SCARD is a Redis command used to get the number of members in a set, it returns the cardinality of the specified set, which is the total count of unique elements it contains. If the set does not exist, SCARD returns 0. This command is useful for quickly determining the size of a set, allowing applications to make…
SUNION
The SUNION command returns the members of a set resulting in a union of all the given sets.
SDIFF
The SDIFF coimmand returns the members of a set resulting from the difference between the first set and all the following sets.
More Commands
More Commands
Redis Sets include advanced operations like SRANDMEMBER to retrieve random members from a set, SPOP to remove and return random elements, and SMOVE to atomically move elements between sets. Commands like SSCAN allow for incremental iteration over large sets, avoiding performance issues with massive data structures.…
Usecases
Usecases
Naming Conventions
Naming conventions in Redis are crucial for maintaining organized and understandable data structures, especially in large applications. Common practices include using colons (:) as separators for hierarchical keys (e.g., user:1001:settings), employing prefixes to group related keys (e.g., session:, cache:), and…
Retrieval by Pattern
The SCAN command in Redis is a cursor-based iterator that does not guarantee to return all matching keys in one call, even if COUNT is specified. Instead, SCAN returns a small subset of keys that match the pattern, requiring subsequent calls to complete the iteration. Redis offers powerful pattern-based key…
Expiration
Redis key expiration allows you to set a time-to-live (TTL) for keys, automatically deleting them after a specified duration. This can be achieved using commands like EXPIRE, which sets the expiration time in seconds, or PEXPIRE, which uses milliseconds for finer granularity. You can also use SET with the EX…
Stage 8: Pipelining
Pipelining
Pipelining in Redis is a technique that allows clients to send multiple commands to the server without waiting for individual responses after each command. Instead, the commands are sent in a batch, and responses are read together at the end. This reduces the network overhead and latency associated with multiple…
Usecases
Stage 9: Bitmaps
Bitmaps
In Redis, Bitmaps are a data structure that allows you to manipulate individual bits within a string value. While Redis doesn't have a native "bitmap" data type, it uses strings to represent bitmaps. The power of bitmaps comes from their ability to perform operations on binary data at the bit level, making them…
SETBIT
The SETBIT command sets or clearts the bit at the specified offset in the string value that is stored at the specified key. When the key does not exist, a new string value will be created and the string is grown to make sure it can hold a bit to the same value as the earlier defined offset.
GETBIT
The GETBIT command in Redis retrieves the value of a specific bit at a given offset in a string key. It returns either 0 or 1, depending on the state of the bit at that position. If the key does not exist, the command returns 0, as it treats non-existing keys as empty strings. This command is particularly useful…
BITOP
The BITOP command in Redis performs bitwise operations (AND, OR, XOR, and NOT) across one or more string keys, treating the strings as binary data. The result is stored in a destination key. This command is useful for manipulating and analyzing binary data directly in Redis, such as when aggregating flags or…
BITPOS
The BITPOS command in Redis is used to find the position of the first bit set to 1 or 0 in a string key. You can specify a starting and ending byte range for the search. It’s commonly used in scenarios where you need to quickly locate specific bits within a bitmap, such as finding the first occurrence of a flag or…
BITCOUNT
The BITCOUNT command in Redis is used to count the number of bits set to 1 (i.e., the number of binary 1s) in the value stored at a specific key. Since Redis allows string values to be stored as binary data, the BITCOUNT command becomes useful for operations involving bits, like efficiently tracking and counting…
Stage 10: Batch Operations
Batch Operations
Batch operations in Redis allow you to execute multiple commands efficiently in a single network round-trip. While Redis does not have true batching like some databases (where a set of operations are sent together and processed atomically), it provides ways to send multiple commands together to reduce the overhead…
Stage 11: HyperLogLog
HyperLogLog
HyperLogLog is a probabilistic data structure in Redis used for efficiently estimating the cardinality (i.e., the number of unique elements) of large datasets with minimal memory usage. Instead of storing the actual elements, it maintains a compressed representation, allowing it to estimate cardinality with a…
Usecases
XADD
The XADD command used to append new entries to a stream data structure. It allows you to add one or more field-value pairs as a single entry, automatically assigning a unique ID to each new entry.
XREAD
The XREAD command reads data from one or more streams, only returning entries with an ID greater than the last received ID.
XRANGE
The XRANGE command used for retrieving messages from a stream. It allows you to query a range of messages based on their IDs, returning them in chronological order. This command is particularly useful for reading a portion of a stream's history, enabling efficient data retrieval and processing.
XLEN
The XLEN command used to get the length of a stream, returning the number of entries it contains. This simple yet powerful command provides a quick way to assess the size of a stream without retrieving its contents. Unlike other Redis types, zero-length streams are possible so XLEN should be used in tandem with…
More Commands
Streams include a variety of operations that enhance the core functionality provided by basic commands like XADD and XREAD. Examples include XDEL to remove specific entries from a stream, XTRIM to control the size of a stream by trimming old entries, and XGROUP for managing consumer groups, allowing multiple…
GEOADD
The GEOADD command in Redis is used to add geospatial data to a sorted set, where each entry consists of a member (a unique identifier) and its corresponding longitude and latitude coordinates. This command allows you to store location-based data efficiently, enabling geospatial queries such as finding members…
GEOSEARCH
The GEOSEARCH command in Redis is used to query geospatial data by finding members within a specified geographic area. It allows you to search for entries based on a central point (latitude and longitude) and a defined radius, or by bounding box coordinates. The command returns a sorted set of members that fall…
More Commands
Redis Geospatial indexes include operations like GEODIST to calculate the distance between two members of a geospatial set, GEOHASH to retrieve the Geohash representation of locations, and GEOPOS to get the longitude and latitude of specified members. Additionally, GEORADIUS and GEORADIUSBYMEMBER allow searching…
PFMERGE
PFMERGE is a Redis command used to combine multiple HyperLogLog data structures into a single HyperLogLog key, creating a new structure that represents the union of all unique elements. This command is useful when you want to aggregate and estimate the cardinality of distinct elements across multiple datasets. The…
PFADD
PFADD command used to add elements to a HyperLogLog data structure, which is designed for estimating the cardinality (number of unique elements) of a dataset. When elements are added using PFADD, Redis updates the internal structure without storing the actual elements, ensuring low memory consumption. This command…
PFCOUNT
PFCOUNT is a Redis command used to retrieve the estimated number of unique elements in one or more HyperLogLog structures. It provides an approximate cardinality count with a typical error rate of 0.81%, making it highly efficient for large datasets while using minimal memory. When called with multiple HyperLogLog…
Stage 12: Streams
Stage 13: Geospatial Indexes
Geospatial Indexes
Geospatial indexes in Redis are used to efficiently store and query location-based data, enabling fast geospatial operations. Redis uses a sorted set data structure to maintain these indexes, where each member represents a geographic location identified by longitude and latitude coordinates. The coordinates are…
Stage 14: Lua Scripting
Lua Scripting
Lua scripting in Redis allows users to execute custom scripts atomically on the server side, enabling complex operations to be performed in a single step. Lua scripts are run using the EVAL or EVALSHA commands, and can manipulate multiple keys and values in a single execution. This reduces network overhead and…
Stage 15: Transactions
Transactions
Redis Transactions allow the execution of a group of commands in a single step, they are centered around the commands MULTI, EXEC, DISCARD and WATCH.
Stage 16: Pub/Sub
Pub/Sub
Pub/Sub in Redis is a powerful messaging paradigm that allows for real-time communication between clients through a publish/subscribe model. In this system, publishers send messages to specific channels without knowing who, if anyone, will receive them. Subscribers, on the other hand, express interest in particular…
Stage 17: Persistence Options
Persistence Options
Redis provides two main persistence options: RDB (Redis Database Backup) and AOF (Append-Only File). RDB creates point-in-time snapshots of the dataset at specified intervals, offering efficient storage with minimal performance impact, making it suitable for periodic backups but with potential data loss between…
EVAL
The EVAL command in Redis allows the execution of Lua scripts directly on the server, enabling complex operations that can be atomically executed. This command takes a Lua script as an argument, along with a list of keys and arguments for the script. By executing scripts server-side, EVAL reduces the number of…
EVALSHA
The EVALSHA command in Redis is used to execute a Lua script that has already been loaded into the server with the SCRIPT LOAD command. Instead of sending the entire script each time, you provide the SHA1 hash of the script, which allows for more efficient execution and reduced network overhead. Like EVAL, EVALSHA…
WATCH
The WATCH command marks the given keys to be watched for conditional execution of a transaction. It's a critical component of Redis's approach to handling race conditions in multi-key transactions.
EXEC
The EXEC command in Redis is used to execute a transaction that has been initiated with the MULTI command. When a transaction is started with MULTI, subsequent commands are queued but not executed immediately. Calling EXEC will execute all the commands in the transaction atomically, ensuring that either all…
MULTI
MULTI is a Redis command used to start a transaction, allowing a group of commands to be executed sequentially and atomically. After initiating a MULTI block, commands are queued instead of being executed immediately. Once all desired commands are added, the EXEC command is called to run them as a single atomic…
SUBSCRIBE
The SUBSCRIBE command subscribes the client to the channels specified, once subscribed the client enters a state where it is not supposed to issue any other commands, except from those in the SUBSCRIBE subset i.e. SSUBSCRIBE, PSUBSCRIBE etc.
UNSUBSCRIBE
The UNSUBSCRIBE command unsubscribes the client for the given channels, or all channels if none are specifically stated.
PUBLISH
PUBLISH is a Redis command used to send messages to a specified channel in the pub/sub messaging system. When a message is published, all clients that are subscribed to that channel receive the message immediately. This command is useful for implementing real-time communication features, such as chat applications,…
More Commands
Redis Pub/Sub include operations like PSUBSCRIBE and PUNSUBSCRIBE for subscribing and unsubscribing to channels using pattern matching, allowing for flexible topic-based subscriptions. Additionally, PUBSUB CHANNELS lists active channels, PUBSUB NUMSUB shows the number of subscribers per channel, and PUBSUB NUMPAT…
Usecases
Optimistic Locking
Optimistic locking in Redis is implemented using the WATCH command in combination with transactions (MULTI and EXEC). WATCH monitors specified keys for changes before starting a transaction. If any of the watched keys are modified by another client before EXEC is called, the transaction is aborted, and EXEC returns…
Stage 18: Authentication
Authentication
Authentication in Redis is a security feature used to restrict access to the server by requiring clients to authenticate themselves with a password before performing any commands. This helps prevent unauthorized users from connecting to your Redis instance and performing operations.
Usecases
Stage 19: Network Security
Network Security
Network security in Redis involves implementing measures to protect the server from unauthorized access and data breaches. Best practices include binding Redis to trusted interfaces, using firewalls to restrict access, and configuring requirepass for password protection. Redis should run in a secure network…
No Persistence Option
The No Persistence option in Redis disables all data persistence mechanisms, meaning that no data will be saved to disk. This can be configured by turning off both RDB snapshots and AOF (Append-Only File) logging. Running Redis without persistence is ideal for use cases where high-speed caching is prioritized over…
How RDB Works?
The RDB (Redis Database Backup) mechanism in Redis creates snapshots of the dataset at specified intervals and saves them to disk as a compact binary file. This process is triggered manually, via the SAVE or BGSAVE commands, or automatically based on predefined conditions. During a snapshot, Redis forks a child…
Configuring Save Interval
Configuring the save interval in Redis controls how often data is saved from memory to disk (RDB snapshots). This is done using the save directive in the redis.conf file. You can specify multiple save intervals with different thresholds, for example: save 900 1 saves the dataset if at least one key is changed…
Usecases / Best Practices
Usecases / Best Practices
Stage 20: SSL/TLS Encryption
SSL/TLS Encryption
SSL/TLS is supported by Redis starting with version 6 as an optional feature that needs to be enabled at compile time. TLS will add a layer to the communication stack with overheads due to the read and writes from an SSL connection and integrity checks, this will lead to a decrease of achieveable throughput.
Stage 21: Replication Basics
Replication Basics
Replication in Redis is a process that allows data from one Redis instance (the master) to be copied to one or more Redis instances (the replicas). This mechanism enhances data availability, reliability, and scalability. When a master instance receives write operations, it propagates these changes to its replicas,…
Stage 22: Redis Sentinel
Redis Sentinel
Redis Sentinel serves as a robust high-availability solution for Redis deployments, offering a comprehensive suite of monitoring, notification, and automatic failover capabilities. By continuously overseeing master and replica Redis servers, Sentinel ensures system integrity and swift response to failures. In the…
Stage 23: Clustering
Clustering
Redis Cluster is a distributed implementation of Redis that provides automatic data partitioning across multiple nodes and ensures high availability through data replication. It uses a sharding mechanism to split data across nodes using a hash slot system, where each key is mapped to one of 16,384 slots distributed…
Stage 24: Redis Modules
Redis Modules
Redis Modules are extensions that enhance the core functionality of Redis by adding new data types, commands, and capabilities. These modules allow developers to customize and extend Redis to better fit specific application needs without modifying the core Redis source code. Examples of popular Redis Modules include:
Search
Redis Search enhances the Redis experience by offering a robust set of search and query features, including a rich query language, incremental indexing for JSON and hash documents, vector search, full-text search, geospatial queries, and aggregations. These capabilities allow Redis to function as a document…
RedisTimeSeries
RedisTimeSeries is a Redis module specifically designed for efficiently storing, querying, and managing time-series data, making it ideal for applications such as IoT monitoring, financial data analysis, and real-time analytics. It allows users to easily ingest time-stamped data, perform aggregations, and retrieve…
RedisBloom
RedisBloom is a Redis module that extends the capabilities of Redis by introducing probabilistic data structures, allowing for efficient membership testing and counting while minimizing memory usage. It provides tools such as Bloom Filters, Cuckoo Filters, Count-Min Sketches, and HyperLogLogs, enabling developers…
RedisJSON
RedisJSON is a Redis module that enables the storage, retrieval, and manipulation of JSON documents directly within Redis. It provides a rich set of commands for working with JSON data structures, allowing users to perform operations such as adding, updating, and querying JSON documents efficiently. With RedisJSON,…
How AOF Works?
The Append-Only File (AOF) in Redis is a persistence mechanism that logs every write operation to a file in sequential order, ensuring data durability. Each command is appended to the end of the AOF file, which Redis can replay to rebuild the dataset in case of a restart. The AOF file can grow over time, so Redis…
AOF rewrite & compaction
Persistence refers to the writing of data to durable storage, such as a solid-state disk (SSD). Redis provides a range of persistence options of which AOF (Append Only File) is one of the options. AOF persistence logs every write operation received by the server. These operations can then be replayed again at…
Truncation / Corruption
Truncation and corruption typically refer to scenarios where data is unexpectedly cut off or altered, compromising its integrity. This can occur due to various reasons, such as sudden power failures, system crashes, or disk errors. Redis mitigates these risks through its persistence mechanisms like RDB snapshots…
Usecases
INFO
INFO command that provides detailed information and statistics about the server, including memory usage, CPU load, connected clients, replication status, and more. It can be called without arguments to get a full overview or with specific sections (e.g., INFO memory) to retrieve targeted data. This command is…
MONITOR
MONITOR is a Redis command that provides a real-time feed of all commands executed on the server, displaying each command along with its arguments as they are processed. It is primarily used for debugging, monitoring, or analyzing the behavior of a Redis instance. Since MONITOR can impact performance by streaming…
Max Memory Policy
The Max Memory Policy in Redis determines how the server handles data when it reaches the configured maximum memory limit. Redis offers several eviction policies, such as noeviction (return an error on writes), allkeys-lru (evict the least recently used keys), volatile-lru (evict the least recently used keys with…
Memory Management
Memory management in Redis involves efficiently handling data storage within its in-memory structure to maximize performance and prevent memory overflows. Redis uses various techniques such as memory-efficient data encoding (e.g., ziplist or intset), active and passive eviction strategies based on the configured…
Slow Log Analysis
The Redis Slow Log in a system to log any queries that take longer than a specified time. The execution time does not include any I/O operations such as talking with the client, just the time need to execute the specified command.
redis-benchmark
redis-benchmark is a utility provided with Redis that measures the performance of the Redis server by simulating various types of workloads. It allows users to test the speed and responsiveness of Redis commands under different conditions, providing metrics such as requests per second and latency. The tool can…
Monitoring
Monitoring in Redis involves tracking the health, performance, and resource usage of the server to ensure optimal operation and early detection of issues. Tools and commands like INFO (providing statistics on memory, CPU, and clients), MONITOR (real-time command tracking), and SLOWLOG (logging slow queries) offer…
RedisInsight
RedisInsight is an advanced graphical user interface (GUI) tool developed by Redis Labs that provides comprehensive management and monitoring capabilities for Redis databases. It offers users an intuitive interface to visualize and interact with their Redis data, making it easier to manage data structures such as…
RedisCommander
RedisCommander is a web-based GUI management tool for Redis that simplifies the interaction with Redis databases through a user-friendly interface. It allows users to browse, edit, and manage Redis keys and data structures easily, providing visual representations of data types such as strings, hashes, lists, sets,…
RDB vs AOF Tradeoffs
When comparing RDB (Redis Database Backup) and AOF (Append-Only File) for data persistence in Redis, several trade-offs must be considered.
Hybrid Persistence
Hybrid persistence in Redis combines both RDB (Redis Database Backup) and AOF (Append-Only File) mechanisms to leverage the benefits of each. RDB provides efficient snapshot-based backups at defined intervals, while AOF logs every write operation to ensure minimal data loss. Using both, Redis achieves a balance…
Stage 25: redis.conf
redis.conf
redis.conf is the configuration file used by Redis to set up server parameters and customize its behavior. This file allows administrators to specify various settings, including memory limits, persistence options (like RDB and AOF), network configurations (such as port and binding addresses), and security features…
Stage 27: Upgrading Redis
Upgrading Redis
Upgrading Redis typically involves careful planning and execution to ensure minimal downtime and data integrity. The process generally includes backing up your data, installing the new Redis version, updating configuration files to accommodate any new settings or deprecated options, and restarting the Redis server.
Stage 28: Backup and Recovery
Backup and Recovery
Backing up and recovering Redis data is crucial for ensuring data persistence and reliability. Redis, by default, stores its data in memory for fast access, but it provides mechanisms to persist data to disk to allow for recovery in case of failure or system restarts. The primary methods for backup and recovery in…
Stage 26: Disaster Recovery
Disaster Recovery
Disaster recovery in Redis involves strategies and practices to ensure data availability and integrity in the event of failures, such as server crashes, data corruption, or network issues. Key approaches include leveraging Redis's built-in replication, where data is copied from master to replica nodes for…
Stage 29: Redis Enterprise
Redis Enterprise
Redis Enterprise is a commercial offering that extends the capabilities of open-source Redis with advanced features designed for high availability, scalability, and performance in enterprise environments. It provides automatic sharding and replication, allowing for seamless horizontal scaling across multiple nodes…
Active-Active geo Distribution
An Active-Active architecture is a data resiliency architecture that distributes the database information over multiple data centers via independent and geographically distributed clusters and nodes. It is a network of separate processing nodes, each having access to a common replicated database such that all nodes…
Redis on Flash
Redis on Flash is a feature of Redis Enterprise that allows users to extend the memory capacity of their Redis instances by utilizing SSDs (Solid State Drives) alongside traditional RAM. This enables organizations to store larger datasets at a lower cost while maintaining the high performance that Redis is known…
Security and Compliance
Security and compliance in Redis involve implementing various measures to protect data, ensure secure access, and adhere to relevant regulatory standards. Redis provides several built-in security features, such as password authentication using the requirepass directive, which restricts access to authorized users…
When to consider enterprise?
Redis Enterprise is typically considered when an organization requires enhanced scalability, high availability, and advanced features beyond what open-source Redis provides. It's particularly valuable for large-scale applications with demanding performance requirements, complex architectures, or mission-critical…
Questions about the Redis Roadmap
Is the Redis Roadmap free?
Yes. All 162 lessons in this roadmap are free to read on Bibha AI Learning Labs, with no account and no payment. Signing in is optional: it lets you mark lessons as done and keep your progress, and it opens the AI tutor, which runs on your own API key.
How long does the Redis Roadmap take?
There is no fixed duration. It has 162 lessons in 29 stages, and the time it takes depends on how many hours you give it each week. Nothing is locked, so you can skip what you already know, and your progress is saved once you sign in.
Where should I start the Redis Roadmap?
Start with stage 1, What is Redis?, and work down in order. The stages are numbered in the order the roadmap suggests, but every lesson is open, so if you already know What is Redis? you can go straight to Strings or anything after it. Each lesson links to free resources for going deeper.
Can I learn Redis in Hindi?
The lessons are written in English. Once you sign in, you can ask the AI tutor on any lesson to explain it in Hindi or Hinglish. It answers from that lesson’s own text, so the explanation stays on the syllabus. The tutor runs on your own Google, OpenAI or Anthropic key.