Meet Valkey: Why Redis Changed Its License, Why Valkey is Better, and How to Use It as a Drop-in Replacement
CK 3788 Created at Updated at
10500
Most recently, my server was migrated to AlmaLinux 10 from CentOS 7, and it was found that there is no Redis available, but ValKey is available instead. It felt strange that Redis was replaced by Valkey, and I had to use it.
Valkey is an open-source, high-performance in-memory data store designed to act as a direct alternative to Redis. It supports data structures such as strings, hashes, lists, sets, sorted sets, bitmaps, and hyperloglogs, making it suitable for caching, message brokering, and primary database use cases.
Origin: Created in March 2024 as an open-source fork of Redis 7.2.4.
Governance: Hosted by the Linux Foundation, ensuring neutral, community-driven development.
Key Backers: Industry leaders including Amazon Web Services (AWS), Google Cloud, Oracle, Ericsson, Snap Inc., and Aiven.
License:BSD 3-Clause License, which guarantees it remains fully open source and free for commercial use.
Why Redis Changed Its Open-Source Policy
For over a decade, Redis operated under the flexible, open-source BSD license. However, in March 2024, Redis Ltd. announced a major licensing shift away from open source.
1. The License Shift
Redis moved from the BSD license to a dual-licensing model:
RSALv2 (Redis Source Available License v2)
SSPLv1 (Server Side Public License v1)
Under these licenses, Redis is no longer considered "open source" according to the Open Source Initiative (OSI). It is now classified as source-available.
2. Reasons Behind the Change
Commercial Exploitation by Cloud Providers: Redis Ltd. argued that major cloud hyperscalers (such as AWS, GCP, and Azure) were offering managed Redis services and generating massive revenue without contributing proportionately back to the open-source code base.
Monetization Pressures: Redis Ltd. sought to force major cloud providers to enter commercial licensing agreements to use the software as a service, thereby protecting their own revenue stream.
3. Impact on the Community
Cloud providers and third-party vendors can no longer host the latest versions of Redis for free without purchasing a license or open-sourcing their own management infrastructure.
Developers and organizations faced vendor lock-in risks, legal uncertainties, and potential cost increases for running Redis managed services.
Advantages of Valkey Over Redis
Valkey was created to preserve the original vision of Redis while introducing significant architectural and governance improvements.
1. Truly Open Source & Permissive
No Vendor Lock-In: Governed by the Linux Foundation, Valkey cannot be arbitrarily re-licensed by a single commercial entity.
Free Commercial Use: The BSD 3-Clause license allows businesses to modify, host, and integrate Valkey without paying licensing fees.
2. Backed by a Massive Industry Alliance
Major tech companies (AWS, Google, Oracle) are actively pooling engineering resources into Valkey, accelerating bug fixes, security patches, and feature additions far faster than a single vendor could manage.
3. Architectural & Performance Enhancements
While maintaining backward compatibility, Valkey 8.0 introduced core improvements:
Multithreading Improvements: Enhancements to I/O processing reduce latency under heavy read/write workloads compared to traditional Redis.
Memory Efficiency: Optimized data layout and reduced memory fragmentation, yielding lower RAM consumption.
Faster Failovers & Cluster Scaling: Improved cluster state management and faster slot migrations during scaling operations.
How to Use Valkey as a Drop-In Replacement for Redis
Valkey is engineered to be 100% backward compatible with Redis 7.2. You can switch from Redis to Valkey with minimal configuration changes.
1. Executables and Commands Mapping
Valkey renames the Redis binaries, but maintains identical command syntax and protocol (RESP):
Action
Redis Command
Valkey Equivalent
Server
redis-server
valkey-server
CLI
redis-cli
valkey-cli
Benchmark
redis-benchmark
valkey-benchmark
Port
6379
6379 (Default remains identical)
2. Installation & Quick Start
Using Docker:
# Pull and run the official Valkey container
docker run --name my-valkey -p 6379:6379 -d valkey/valkey:latest
# Connect via CLI
docker exec -it my-valkey valkey-cli
Using native binaries (Ubuntu/Debian example):
# Start Valkey service
sudo systemctl start valkey
# Connect using valkey-cli or redis-cli (both work with Valkey server)
valkey-cli ping
# Output: PONG
3. Client Libraries Compatibility
You do not need to rewrite your application code. Existing Redis drivers in virtually all programming languages (e.g., redis-py, Jedis, go-redis, ioredis) work seamlessly with Valkey out of the box because Valkey uses the RESP2/RESP3 protocol.
Example using Python redis library connected to a Valkey server:
import redis
# Connects to Valkey running on default port 6379
client = redis.Redis(host='localhost', port=6379, db=0)
client.set('key', 'Hello from Valkey!')
print(client.get('key').decode('utf-8'))
# Output: Hello from Valkey!
4. Migration Steps from Redis to Valkey
Backup Data: Trigger a save on your existing Redis instance to generate an dump.rdb file (redis-cli SAVE).
Install Valkey: Set up valkey-server on your target environment.
Move RDB File: Copy the dump.rdb file to the Valkey working directory.
Start Valkey: Launch valkey-server. It will automatically parse the existing Redis RDB snapshot and load the dataset into memory without data corruption or loss.