Redis Software supports both RESP2 and RESP3 protocols, enabling flexible client communication across versions. This article outlines RESP version support by Redis version, explains how to enable or disable RESP3 at both the cluster and database levels, clarifies client compatibility requirements, and summarizes common upgrade issues and troubleshooting patterns. Key sections include Supported RESP Versions, Step-by-Step Instructions, Client Compatibility, Common Issues and Troubleshooting, and Additional Resources.
Supported RESP Versions
-
RESP2 (Redis Serialization Protocol v2):
Supported in all versions of Redis Software.
This is the legacy protocol and remains compatible across versions, including Redis 7.2 and later. -
RESP3 (Redis Serialization Protocol v3):
Supported starting in Redis Software 7.2 and later.- Enabled by default for new databases created in 7.2+.
- Existing databases upgraded to 7.2+ can enable RESP3 manually.
-
Both protocols (RESP2 and RESP3) remain available when RESP3 is enabled. Clients negotiate the protocol version during connection using the
HELLOcommand.
Important: Features like sharded pub/sub and client-side caching require RESP3 and are unavailable with RESP2.
Note: Redis Software versions that support RESP3 continue to support RESP2.
Step-by-Step Instructions
Enable RESP3 on a Database
- Ensure your Redis Software cluster is running version 7.2 or later.
- For Active-Active databases, all participating databases must also be 7.2+.
-
RESP3 is enabled by default for new databases. To confirm or enable manually:
-
CLI:
rladmin tune db db:<ID> resp3 enabled
-
REST API:
PUT /v1/bdbs/<uid> { "resp3": true }
-
If you need to disable RESP3
-
CLI:
rladmin tune db db:<ID> resp3 disabled
-
REST API:
PUT /v1/bdbs/<uid> { "resp3": false }
Change Default Protocol for New Databases
- Cluster-wide default RESP3 setting (new DBs only):
-
CLI:
rladmin tune cluster resp3_default disabled
-
REST API:
PUT /v1/cluster/policy { "resp3_default": false } -
UI:
Navigate to Databases → Upgrade Configuration → toggle RESP3 support.
-
Client Compatibility
After configuring RESP3 on your database, ensure your client applications are compatible.
-
Auto-RESP3 Clients:
Libraries like Go-Redis v9+ and Lettuce v6+ default to RESP3. -
When to pin to RESP2:
Before upgrading Redis to 7.2+ with auto-upgrading clients
When using feature not yet RESP3-compatible
During gradual migration phases
Examples:
-
Go-Redis
For applications using Go-Redis v9.0.5 or later, set the protocol version to RESP2:
redis.NewClient(&redis.Options{ Addr: "your-db-endpoint:port", Protocol: 2, // Forces RESP2 }) -
Lettuce
To set the protocol version to RESP2 with Lettuce v6 or later:
import io.lettuce.core.*; import io.lettuce.core.api.*; import io.lettuce.core.protocol.ProtocolVersion; RedisClient client = RedisClient.create("redis://your-db-endpoint:port"); client.setOptions(ClientOptions.builder() .protocolVersion(ProtocolVersion.RESP2) .build());If you are using LettuceMod, you need to upgrade to v3.6.0.
Common Issues and Troubleshooting
-
Clients Disconnect After RESP3 Disablement
- Cause: Clients using RESP3 are forcibly disconnected.
Solution: Restart affected clients or configure them for RESP2.
-
Sharded Pub/Sub Unavailable
- Cause: Feature requires RESP3 enabled
Solution: Enable RESP3 for the database
-
Client-Side Caching Compatibility
Cause: Requires both RESP3 and Redis Software 7.4+
Solution: Upgrade Redis Software and enable RESP3.
-
Command Errors (HELLO/NOPROTO)
- Cause: Using RESP3 features with incompatible Redis/client versions.
Solution: Verify Redis Software 7.2+ and client RESP3 support.
-
Feature Gaps in Commands
Cause: Some subcommands (like
REDIRECT) may not be supported in Redis Software.Solution: Commands like
CLIENT TRACKINGonly work in RESP3 on Redis 7.4+.
-
Migration Format Changes
Cause: RESP2 and RESP3 format responses differently.
Solution: Test applications thoroughly when switching protocols.
0 comments
Please sign in to leave a comment.