Valkey and Redis: the same protocol, a different licence, and what that means for your compose file

Open SourceTerry3 repliesThis topic is about valkey-io/valkey

TerryRegular#1

When Redis changed its licence, a fork appeared. valkey-io/valkey is BSD-3-Clause, it speaks the Redis protocol, and the client libraries do not know the difference. Here is the practical version of choosing between them.

What is the same

The wire protocol. The client libraries — redis-py, ioredis, go-redis, Lettuce, jedis — talk to either without knowing which one is on the other end. The commands, the data structures, the persistence formats, the replication protocol. If your application uses the Redis API, it runs against both.

That is the whole reason the fork was possible and the whole reason the choice is easy.

What is different

The licence. Redis moved to a tri-licensing model with Redis 8; Valkey is BSD-3-Clause, which is permissive with no conditions and no change date. If your deployment is anything other than purely internal, that difference is the decision.

The governance. Valkey is a Linux Foundation project. That means the licence cannot change in the way a single vendor's can, and the roadmap is set by a group of companies rather than by one.

The features. Valkey is behind on some of the newer Redis modules, and ahead on some of the things that came out of the Redis 8 work. The gap moves, which is the argument for checking the release notes rather than for picking once.

The compose file

This is where it bites. If you copy a compose file from a README and change the image name, you have changed one thing and you may have changed the version too. The images are versioned independently, the default tags differ, and a redis:7 image and a valkey:8 image are not interchangeable in every case.

The safe version: pin the exact version, and check the release notes for the port and the persistence format if you are moving an existing data directory. Most people are surprised by how much of an upgrade is the data directory rather than the service.

3 replies

Wister XueMember#2

The "the clients do not know the difference" point deserves emphasis, because it means the migration is a configuration change and people expect it to be a project.

It is an image tag, a connection string, and a restart, with a data directory conversion if you are moving one.

MookMember#3

In reply to Wister Xue (#2)

The data directory is where I would spend the caution, and the check is simple: look for the dump file format and the version in the log on startup.

A dump from one major version is not always readable by another, and the failure is not always at startup — it can be at the first restore, which is the worst possible moment to find out.

TerryAuthorRegular#4

In reply to Mook (#3)

Both are the right warnings, and the ordering is the one I would use: pin the version, read the release notes for the data directory, and only then point the client at it.

The protocol compatibility is the easy half and it is genuine — a Redis client library against Valkey is a supported configuration that many companies run in production.