Estimate project
← All posts

6 underrated Redis features worth trying

Discover 6 underrated Redis features and learn why they are worth a try.

6 min read
ArchitectureCacheRedis

Introduction

The Redis database is a well-known, indispensable infrastructure component, typically used as a cache and frequently seen as nothing more than a fast key-value store. Over the years, though, it has grown into a data platform packed with features, providing a lot more than raw speed.

Back in 2021, I analyzed the server code of Signal Internet Messanger. I was struck by the interesting ways it used Redis Pub/Sub and the Redis Lua interpreter. In this post, we’ll look at Redis server features that aren’t widely known, yet are powerful and reach far beyond plain caching.

What is Redis?

Redis is an in-memory database built for storing and retrieving data at high speed. Whereas traditional databases depend on disk storage, Redis holds frequently used data in the server’s memory, so applications can get it almost immediately. That makes it a great fit for data that is accessed often, such as session information, user preferences, or real-time analytics.

A major advantage of Redis is how it helps optimize performance. Because applications don’t have to query a slower disk-based database over and over, Redis reduces server load and keeps applications responsive even when traffic is heavy. Handling frequently requested data efficiently, Redis boosts application performance considerably, which makes it an essential tool for today’s web applications, APIs, and microservices.

Redis features

Redis Streams

Redis Streams is a powerful data structure that works as an append-only log. On top of that, it provides extra capabilities that put it on par with classic streaming solutions such as Apache Kafka. Redis Streams lets you query events by range or subscribe to new items as they arrive in real time. It also supports consumer groups, so several consumers can process the stream together.

Similarities aside, Redis Streams and Apache Kafka have important differences, above all in the way data is partitioned and managed. Redis Streams targets lightweight streaming use cases and lacks Kafka’s partitioning model, but it is still a strong alternative for real-time event processing in Redis environments.

JSON Support

Lately, a lot of databases, SQL-based ones included, have added JSON as a supported data type. The main benefit is that complex objects can be stored in a widely known format, which makes data more flexible and easier to handle.

Redis has followed the same path: it lets you store JSON objects, fetch nested values, and run queries with JSONPath. Redis also supports atomic partial updates, so objects can be modified efficiently without rewriting them completely. This makes Redis a great choice for applications that need dynamic data structures and real-time updates without sacrificing performance.

Gen AI - vector database

Given the recent surge of interest in AI and vector databases, it’s worth knowing that Redis can serve as a vector database too. It lets you store vectors together with metadata, define secondary indexes, and run vector searches, k-nearest neighbor (KNN) search among them. This makes Redis a realistic option for AI-based applications that need quick similarity searches, such as recommendation systems, image recognition, and natural language processing (NLP) tasks.

Still, what Redis brings to AI is not limited to storing vectors. Redis can act as a semantic cache, letting applications keep frequently asked questions in retrieval-augmented generation (RAG) pipelines. It is also key for LLM session storage, preserving the history of user conversations for context-aware interactions. In AI-based applications, picking the right data structures with low latency is essential, and Redis offers a strong mix of speed and scalability for such heavy workloads.

Thanks to its ability to handle real-time queries, serve high-throughput AI models, and manage structured as well as unstructured data efficiently, Redis is a great option for building AI-powered applications. Be it vector similarity search, session storage, or semantic caching, Redis provides the flexibility required to improve AI model performance and offer a smooth user experience.

Time Series

Time series data is usually linked to databases like Prometheus, InfluxDB, ClickHouse, TimeScaleDB, and so on. Yet Redis supports time series data types as well! Redis commands let you query data by time range and run simple aggregations, such as sums, averages, and other statistical calculations.

What makes time series in Redis even more appealing is how well they integrate with popular monitoring and visualization tools. Grafana and Telegraf can both use Redis as a data source, which enables real-time analytics and monitoring. Developers can thus take advantage of Redis’s speed and efficiency for time series workloads, and in some use cases it can replace dedicated time series databases.

Probabilistic data structures

Probabilistic data structures are among the less familiar data types Redis offers. Ever come across Bloom filters? Database engines like Cassandra use them extensively to speed up lookups and cut storage overhead.

Besides Bloom filters, Redis supports Cuckoo filters, HyperLogLog, and other probabilistic structures. They give up perfect accuracy in exchange for huge memory savings, which makes them perfect wherever approximate results are good enough. A Bloom filter, for instance, can tell for sure that an item is absent from a dataset, but it can only estimate whether the item is there.

One practical example is verifying whether a discount code has already been redeemed. When millions of codes need tracking, a well-configured Bloom filter can act as the first line of defense, rejecting invalid requests before they reach the main database. This can cut compute costs and server load significantly, making applications more efficient.

RDI

Redis Data Integration (RDI) is a Redis Enterprise feature that uses Change Data Capture (CDC) mechanisms to sync data from traditional databases into a Redis cluster. The data being transferred can be transformed and filtered along the way, so it fits Redis data structures more easily.

RDI works with sources like Oracle, MySQL, PostgreSQL, and more. Rather than a one-off migration, its goal is continuous synchronization between these systems. Applications can write to a traditional database and read from Redis for quicker access, without having to write to Redis explicitly.

If your application can live with the eventual consistency introduced by the CDC pipeline, RDI can be an effective way to take load off the database. It is especially handy in cache-powered architectures, in which Redis acts as a fast data layer and the underlying database remains the system of record.

Do you know Debezium? RDI uses it under the hood. Debezium is an open-source project for streaming data from Change Data Capture (CDC) to Apache Kafka, or from Kafka to JDBC-compatible databases.

Conclusions

Redis and its forks are common in modern systems. Although it is best known for in-memory storage, its wider feature set deserves attention. Apart from caching, Redis Streams lets you use Redis in event-driven architectures. Redis Streams can be a fast way to start building event-driven features, and once the system grows, moving to a full-blown Apache Kafka cluster may be the logical next step. As Redis is already present in many infrastructures, making use of its existing features can speed up development and deployment without bringing in brand-new systems that need extra maintenance.

The Redis team keeps developing new capabilities that shape the way applications are designed. One noteworthy enhancement is client-side caching, which keeps additional in-memory data right on the application side. It lowers network latency by removing needless round trips and boosts application performance with little effort.

To dig deeper into the Redis project and its data models, I’d suggest checking out Redis University, which offers a variety of courses on basic and advanced Redis features, as well as on Redis Cloud.