4 minute read

Redis: In-Memory Data Platform for Serverless and AI (2026)

Quick Answer

Redis has evolved from a simple in-memory key-value store into a comprehensive multi-model data platform. Redis 8 delivers production-ready vector search with HNSW indexing, hybrid search combining semantic and keyword queries, and REST APIs for serverless compatibility. Important: In 2024, Redis licensing changed from BSD to source-available (RSALv2/SSPLv1). The Linux Foundation now maintains Valkey, an open-source fork.

What is Redis?

Redis (Remote Dictionary Server) is an in-memory data structure store that persists to disk. Unlike traditional databases that treat RAM as cache, Redis keeps the entire dataset in memory for microsecond latency. It supports strings, hashes, lists, sets, sorted sets, JSON, streams, time-series, and high-dimensional vectors.

The 2024 Licensing Fork

Project License Maintainer Status
Redis (official) RSALv2 / SSPLv1 Redis Inc. Source-available
Valkey BSD 3-Clause Linux Foundation Open source

Implication: Cloud providers (AWS, Google, Oracle) cannot sell managed Redis based on versions 7.4+ without commercial agreements. Valkey remains fully open source.

Redis Stack: The Multi-Model Bundle

Redis Stack combines multiple modules into one distribution:

Component Purpose
RedisJSON Native JSON type with atomic updates
RediSearch Full-text search + secondary indexes
RedisTimeSeries Compressed time-series data
RedisBloom Probabilistic structures (Bloom, Cuckoo, Top-K)

Key Features

Vector Search (Redis 8+)

Redis competes with dedicated vector databases through native indexing:

Index Type Use Case Characteristics
HNSW Production ANN O(log N) search, high recall
FLAT Exact search O(N) brute force, 100% recall
SVS-VAMANA Hardware-optimized DiskANN-based algorithm

Constraints:

  • Max dimensions: 32,768
  • Max indexes per DB: 10
  • M parameter: Up to 512 (default: 16)

Hybrid Search with RRF

Redis 8.4 introduced FT.HYBRID for combining vector and text search:

FT.HYBRID my_index "semantic query" "keyword query" RRF 10

The Reciprocal Rank Fusion algorithm merges results from vector and text searches, normalizing scores across different scales.

Data Structures

Structure Use Case Key Commands
String Caching, counters GET, SET, INCR
Hash Objects HGET, HSET, HMGET
List Queues LPUSH, RPOP, BLPOP
Set Unique items, intersections SADD, SINTER
Sorted Set Leaderboards, ranking ZADD, ZRANGE, ZRANK
Stream Pub/sub, message log XADD, XREAD, XGROUP

Probabilistic Structures

Redis includes memory-efficient structures for massive datasets:

  • HyperLogLog: Cardinality estimation with 12KB for 1B items (0.81% error)
  • Bloom Filters: Set membership testing (no false negatives)
  • Cuckoo Filters: Bloom filter with deletion support
  • Count-Min Sketch: Frequency estimation in streams
  • Top-K: Trending topics detection

Redis vs Competitors

Redis vs Memcached

Feature Redis Memcached
Persistence RDB + AOF None (volatile)
Data Types 8+ structures Simple key-value
Replication Async + Sentinel None
Multithreading I/O threads (v6+) None

Redis vs Upstash

Feature Redis Cloud Upstash
Protocol RESP (TCP) HTTP/REST
Pricing Fixed or Flex Pay-per-request
Serverless Via proxy Native
Edge Limited Global regions

Redis vs Dedicated Vector DBs

Feature Redis (RediSearch) Pinecone Weaviate
Primary Use Multi-model + vectors Vectors only Vectors only
Indexing HNSW / FLAT HNSW only HNSW / Flat / Dynamic
Hybrid Native FT.HYBRID Sparse + dense BM25 + dense
Memory Required Disk-optimized LSM + HNSW

Deployment Options

Redis Cloud (Official)

Tier Cost Features
Essentials (Free) $0 30MB, 100 ops/sec, 30 connections
Fixed $10+/month Dedicated RAM, replication
Redis Flex Usage-based Decoupled storage + compute

Hyperscaler Options

Provider Service Notes
AWS ElastiCache / MemoryDB MemoryDB for durability
Google Cloud Memorystore Vector search limits
Azure Azure Cache for Redis Enterprise tier available

Serverless: Upstash

For serverless and edge workloads:

  • HTTP-based: No TCP connection management
  • Global replication: Multi-region with read-your-writes
  • Pricing: $0.20 per 100,000 commands

Client Libraries

Node.js

Client Type Notes
node-redis Official Modern Promise API
ioredis Community Better cluster support

Python

Client Type Notes
redis-py Standard Thread-safe, connection pooling
RedisVL AI-focused Vector abstraction for RAG

Java

Client Type Notes
Jedis Synchronous Simple, blocking
Lettuce Asynchronous Netty-based, reactive

Operational Considerations

Connection Limits

Redis uses a process-per-connection model:

  • Each connection: ~10MB RAM
  • Limit: Cannot handle tens of thousands of concurrent connections natively
  • Solution: Connection poolers (PgBouncer equivalent) or serverless proxies

Persistence Strategies

Method Description Trade-off
RDB Point-in-time snapshots Compact, but data loss since last snapshot
AOF Append-only log Durable, larger files
Hybrid RDB + AOF Balance of size and durability

Auto Tiering (Enterprise)

Hot data in RAM, warm data on NVMe:

  • Reduces cost for large datasets
  • Transparent to application
  • Maintains low latency for active data

Use Cases: Best For

  • Caching: Session data, API responses, database queries
  • Rate Limiting: Per-IP or per-user request limits
  • Leaderboards: Real-time gaming with sorted sets
  • Pub/Sub: Real-time messaging, chat systems
  • Vector Search: RAG applications with hybrid search
  • Streams: Event sourcing, message queues

Use Cases: Avoid For

  • Primary Database Without Replication: Data loss risk without persistence
  • Large Blob Storage: Store files in S3, not Redis
  • Complex Multi-Row Transactions: Use PostgreSQL instead

Pricing Comparison

Provider Model Entry Point
Redis Cloud Free Fixed 30MB, 100 ops/sec
Redis Cloud Fixed Fixed From $10/month
Redis Flex Usage-based Storage + throughput shards
Upstash Per-request $0.20 per 100K commands
AWS MemoryDB Per-node Depends on instance type

FAQ

Is Redis free?

The Redis core is free, but licensing changed in 2024 to source-available (RSALv2/SSPLv1). The Valkey fork remains fully open-source (BSD). Managed services (Redis Cloud, AWS MemoryDB) charge for hosting.

Yes, Redis 8+ supports HNSW and FLAT vector indexing with up to 32,768 dimensions. Redis 8.4 added hybrid search combining semantic and keyword queries using RRF.

What is the difference between Redis and Valkey?

Valkey is a Linux Foundation fork of Redis 7.2, maintained under the BSD license. Redis (official) moved to source-available licensing in 2024. Both are technically similar, but Valkey remains truly open source.

Can I use Redis with serverless?

Standard Redis requires persistent TCP connections, which doesn’t scale well with serverless. Use Upstash (HTTP-based) or Redis Cloud with connection pooling for serverless deployments.

Does Redis support ACID transactions?

Redis supports transactions via MULTI/EXEC, but they are not fully ACID compliant. Redis offers atomicity for command batches but lacks the isolation levels and rollback capabilities of relational databases.


Related Technologies: Upstash, PostgreSQL, Pinecone, Weaviate, Memcached

Updated: