Migrating Your Java App from Redis Cluster to Valkey Cluster

Published on
Jun 17, 2026

Redis has been a staple in enterprise tech stacks and cloud service offerings for more than 15 years. Numerous distributed applications have been built on Redis Cluster's speed and flexibility. However, the licensing changes Redis underwent in 2024 led to the fully open source fork Valkey skyrocketing in popularity since then. Many apps have been migrated to Valkey Cluster, while some teams have been concerned about breaking mission-critical systems during the migration.

The good news is that a Redis Cluster-to-Valkey Cluster migration doesn't have to be disruptive. In fact, if you run a Java app against Redis Cluster, moving to Valkey Cluster requires no downtime. All you need is a replication tool, the Valkey/Redis Java client Redisson PRO, and a solid migration plan. Here's a look at why Valkey 9 is causing more long-time Redis users to switch, and how you can easily migrate your Java app from Redis Cluster to Valkey Cluster.

Why the Redis License Change Led to the Valkey Fork

When Redis was first released in 2009, it shipped under the highly permissive 3-Clause BSD license, which the Open Source Initiative (OSI) recognizes as complying with the Open Source Definition (OSD). In March 2024, Redis Ltd. announced that, beginning with version 7.4, Redis would switch to a dual model: the Redis Source Available License (RSALv2) and the Server-Side Public License (SSPLv1).

The Redis license change was highly disruptive because the OSI does not recognize SSPLv1 as open source. This meant that cloud providers and any business that embedded Redis as a managed service now needed a commercial agreement with Redis Ltd. Therefore, AWS, Google Cloud, Oracle, and other leading cloud service providers immediately moved their top caching engineers to work on Valkey, the open source fork of Redis.

Valkey retains the BSD 3-Clause license, so no agreements were necessary to keep critical apps built against Redis up and running. By 2025, Valkey crossed 100 million Docker pulls, representing a staggering 17× year-over-year growth.

Even though Redis 8 introduced an AGPLv3 option, which the OSI recognizes as open source, Valkey had already become the default choice for businesses and developers worldwide. In addition, many corporations strictly forbid their developers from using AGPLv3-licensed software due to its strong copyleft clauses, which can require businesses to share their internally developed code for apps built against Redis 8.

Valkey 9 Sets the New Standard for Cluster Operators

Valkey has established itself as the new standard for distributed apps built around data store clusters. Valkey 9, released in October 2025, added these features not found in Redis:

  • Atomic slot migration: Valkey 9 moves slots atomically rather than key-by-key, resolving a long-standing ambiguity over which nodes a key was on.

  • Hash-field expiration: Valkey now allows you to see per-field TTL (time to live) values via HEXPIRE, HEXPIREAT, HEXPIRETIME, HPERSIST, and HTTL. This means you no longer have to split an object just to expire parts of it.

  • Multiple databases in cluster mode: Numbered databases now work inside a cluster instead of being limited to the "db 0" instance only.

  • Improved performance: Pipeline memory prefetching has up to 40% higher throughput in Valkey 9, which now reports over a billion requests per second across 2,000 nodes.

  • Stronger security: Lua scripting has been hardened in Valkey 9, and Valkey 9 can also authenticate clients using native mutual TLS certificates.

Valkey 9.1, released in May 2026, builds on these improvements with per-database access control, background TLS certificate reloading (for no-downtime cert rotations), and new thread-usage metrics.

Why Redisson PRO Works Equally Well With Valkey and Redis

Despite Valkey distinguishing itself from Redis, the Redisson PRO client for Java developers still works equally well with both. That's because Valkey is not a complete rewrite. When it was forked from Redis at version 7.2.4, the codebases of both were identical. Valkey and Redis share enough common DNA in their communication protocols that Redisson PRO is completely interoperable.

More importantly, Valkey maintains compatibility with Redis's RESP2 and RESP3 wire protocols. Both versions are supported in current versions of Valkey and Redis, and are critical in their clustering functionality. RESP is responsible for slot routing, cluster redirection, and pipelining to improve cross-node efficiency. Whether you have a Redis Cluster or a Valkey Cluster, you're working with the same 16,384-slot hash model that supports full primary-replica replication and automatic failover.

Because Redisson PRO speaks RESP, it treats a Valkey Cluster exactly the same as a Redis Cluster. Popular Redisson objects like RMap, RLock, and RBucket work the same and require no changes to your Java code. The same is true of Jedis and Lettuce, but be aware that proprietary Redis modules, such as RedisSearch and RedisJSON, are not available on Valkey. If you rely on these tools and want to switch to a Valkey Cluster, first transition to alternatives like valkey-search and valkey-json before migrating.

A Plan for Migrating Your Java App from Redis Cluster to Valkey Cluster

Now, here are the steps for migrating your Java app from Redis Cluster to Valkey Cluster:

Choose a Replication Tool

There are several replication tools that can stream existing data from Redis into Valkey, while your app continues writing data. Two popular open source options are redis-replicator and RedisShake.

Configure PSYNC or SCAN Mode

Both redis-replicator and RedisShake can run in either PSYNC or SCAN mode. Which one you choose depends on your preference, and if your source cluster allows PSYNC. Some managed cloud services disable PSYNC, although you can often request that your provider enable it.

PSYNC is the Redis command that replicas use to synchronize with a primary. With its support for partial resynchronizations, a replica that briefly disconnects can catch up with the primary without a full data dump. Replication tools in PSYNC mode effectively pretend to be a replica.

You don't call PSYNC in your Java code. Instead, you set up replication, and Redis takes care of the rest:

# On the replica, point it at the primary:
REPLICAOF  
# Example:
REPLICAOF 192.168.1.10 6379

Or, in redis.conf:

replicaof 192.168.1.10 6379

You can check the status on either server with:

INFO replication

If your cloud provider only has SCAN mode enabled, it will also work. However, be aware that SCAN is snapshot-oriented rather than a continuous live tail like PSYNC. As mentioned above, many providers will enable PSYNC upon request, so check with them first.

Perform the Migration

With Redisson PRO's Multi Cluster mode, you can perform the migration with no downtime in just a few steps:

1. Start up your existing Redis Cluster and the target Valkey Cluster.

2. Point your replication tool from the Redis Cluster to the target Valkey Cluster, in PSYNC mode if available. Let the tool stream the keyspace and continue tailing changes.

3. Configure Redisson PRO in Multi Cluster mode with two clusters, your Redis source and Valkey target. Here is an example YAML configuration:

multiClusterServersConfig:
  addresses:
    - "redis://redis-cluster.example.com:6379"    # cluster 1 — primary at start
    - "valkey://valkey-cluster.example.com:6379"  # cluster 2 — passive target
  datastoreMode: ACTIVE
  primaryDiscoveryMode: FIRST_PRIMARY_PUBSUB_NOTIFICATION
registrationKey: "YOUR_REDISSON_PRO_LICENSE_KEY"

The first address is the primary cluster at startup, each address identifies one whole cluster. FIRST_PRIMARY_PUBSUB_NOTIFICATION setting keeps the first cluster as primary and Redisson watches the control channel redisson:multicluster:primary, waiting for a message containing the new primary.

4. Once the replication tool reports that replication is caught up, connect to the Redis Cluster and publish the Valkey Cluster's endpoint, using this redis-cli command:

redis-cli -c -h redis-cluster.example.com -p 6379 \
  PUBLISH redisson:multicluster:primary "valkey-cluster.example.com:6379"

Every Redisson instance will receive the notification and atomically switch its primary to the Valkey Cluster. From this point on, all traffic will flow to Valkey. You can verify this with INFO replication and your application metrics. You can now stop the replication tool and, once you're confident, your old Redis Cluster.

A Problem-Free Migration

Ultimately, this cluster migration is problem-free, thanks to the common heritage shared by Valkey and Redis, a replication tool, and Redisson PRO's versatile Multi Cluster mode. To learn about other features and advantages for Java developers, take a look at the list of Redisson PRO features.

Similar articles