By default, a Tair (Redis OSS-compatible) instance using the classic cluster architecture connects through a database proxy endpoint. To make the instance compatible with the native Redis Cluster protocol, enable direct connection mode and use the direct connection endpoint from your client. This lets your client bypass the proxy node and access backend data nodes directly, reducing latency by eliminating proxy request processing.
This feature is in public preview. Submit a ticket to request access.
Prerequisites
Before you begin, make sure your instance meets all of the following requirements.
The instance must:
Use the cluster architecture with Deployment Mode set to Classic
Be compatible with Redis 5.0 and updated to the latest minor version
Have Transport Layer Security (TLS) disabled — see TLS encryption
Have the vSwitch with enough available IP addresses: direct connection allocates one IP address to the primary node of each shard, plus one for the endpoint itself. For an 8-shard instance, the vSwitch needs at least 9 available IP addresses. To check, see Query the number of available IP addresses for the vSwitch of an instance
The instance must not:
Use the cloud-native cluster architecture in proxy mode — direct connection mode cannot be enabled for this configuration
For a cloud-native cluster instance already in direct connection mode, a direct connection endpoint is provided by default and does not need to be enabled.
Connection modes
| Mode | How it works | Trade-offs |
|---|---|---|
| Direct connection | The client bypasses the proxy and connects directly to backend data nodes. | Lower latency. Maximum connections per shard are reduced: 10,000 for Redis Open-Source Edition, 30,000 for Tair (Enterprise Edition). |
| Proxy mode | Client requests are forwarded by the proxy node to data nodes. See Tair Proxy features. | Higher connection limits. Small processing overhead per request. |
Limitations
Reduced per-shard connections: Because the proxy is bypassed, the maximum number of connections per shard drops to 10,000 (Redis Open-Source Edition cluster) or 30,000 (Tair (Enterprise Edition) cluster). If data skew occurs — where one shard is heavily accessed while others are mostly idle — connections to that shard may be exhausted, causing new connection requests to fail. To diagnose data skew caused by hot spot keys or large keys, see Top Key statistics and Offline full key analysis.
Major version upgrades and zone changes blocked: After enabling direct connection mode, you cannot upgrade the major version or change the zone of the instance. Release the private endpoint first, then perform the upgrade or zone change. See Upgrade the major version, Migrate an instance across zones, and Release a private endpoint.
Configuration changes limited: When changing the configuration of an instance with direct connection enabled, change only the number of shards or shard specifications, and only one at a time. See Why am I unable to change the configurations of a classic (local disk-based) cluster instance?
Enable direct connection
Enabling direct connection does not interrupt your service.
Log on to the console and go to the Instances page. In the top navigation bar, select the region of the instance. Find the instance and click its ID.
In the Connection Information section, click Apply for Endpoint next to Private Endpoint.
In the panel that appears, configure the endpoint and port.
Configuration Description Endpoint Only the prefix can be modified. The default prefix is the instance ID. A custom prefix must start with a lowercase letter and contain only lowercase letters and digits, 8–40 characters in length. Port Number Must be between 1024 and 65535. You can change the port number when you modify the endpoint. Click OK.
For a connection example, see Connect to an instance in direct connection mode.
FAQ
I meet all the prerequisites, but I cannot find the Apply for Endpoint button. What should I do?
Update the instance to the latest minor version. See Update the minor version and proxy version.
Can I use the direct connection endpoint and the proxy endpoint at the same time?
For a classic cluster architecture, yes — both modes can be active simultaneously. For a cloud-native cluster architecture, only one mode can be active at a time.
API reference
| API operation | Description |
|---|---|
| AllocateDirectConnection | Request a direct connection endpoint for a cluster instance. |
| ReleaseDirectConnection | Release the direct connection endpoint of a cluster instance. |
What's next
Release a private endpoint (optional)