Updated on 2023-09-28 GMT+08:00

Master/Standby Redis

This section describes master/standby DCS Redis instances.

  • You cannot upgrade the Redis version for an instance. For example, a master/standby DCS Redis 4.0 instance cannot be upgraded to a master/standby DCS Redis 5.0 instance. If your service requires the features of higher Redis versions, create a DCS Redis instance of a higher version and then migrate data from the old instance to the new one.

Features

Master/Standby DCS instances have higher availability and reliability than single-node DCS instances.

Master/Standby DCS instances have the following features:

  1. Data persistence and high reliability

    By default, data persistence is enabled by both the master and the standby nodes of a master/standby DCS Redis instance.

    The standby node of a Redis 4.0/5.0/6.0 instance is visible to you. You can read data from the standby node by connecting to it using the instance read-only address.

  2. Data synchronization

    Data in the master and standby nodes is kept consistent through incremental synchronization.

    After recovering from a network exception or node fault, master/standby instances perform a full synchronization to ensure data consistency.

  3. Automatic master/standby switchover

    If the master node becomes faulty, the instance is disconnected and unavailable for several seconds. The standby node takes over within 30 seconds without manual operations to resume stable services.

  4. Multiple DR policies

    Each master/standby DCS instance can be deployed across AZs with physically isolated power supplies and networks. Applications can also be deployed across AZs to achieve HA for both data and applications.

  5. Read/write splitting

    Master/standby DCS Redis 4.0/5.0/6.0 instances support client read/write splitting. When connecting to such an instance, you can use the read/write address to connect to the master node or use the read-only address to connect to the standby node.

    If you use a master/standby instance and need client-side read/write splitting, configure the client. If read/write splitting is required, read/write splitting instances are recommended.

Architecture of Master/Standby DCS Redis 4.0/5.0/6.0 Instances

The following figure shows the architecture of a master/standby DCS Redis 4.0/5.0/6.0 instance.

Figure 1 Architecture of a master/standby DCS Redis 4.0/5.0/6.0 instance

Architecture description:

  1. Each master/standby DCS Redis 4.0/5.0/6.0 instance has a domain name address (for connecting to the master node) for read and write and an address (for connecting to the standby node) for read only.

    These addresses can be obtained on the instance details page on the DCS console.

  2. You can configure Sentinel for a master/standby Redis 4.0/5.0/6.0 instance. Sentinels monitor the running status of the master and standby nodes. If the master node becomes faulty, a failover will be performed.

    Sentinels are invisible to you and is used only in the service. For details about Sentinel, see What Is Sentinel?

  3. A read-only node has the same specifications as a read/write node. When a master/standby instance is created, a pair of master and standby nodes are included in the instance by default.
    • For DCS Redis 4.0/5.0/6.0 instances, you can customize the port. If no port is specified, the default port 6379 will be used. In the architecture diagram, port 6379 is used. If you have customized a port, replace 6379 with the actual port.
    • Read-only domain names of master/standby DCS Redis 4.0, 5.0, or 6.0 instances do not support load balancing. For high reliability and low latency, use cluster or read/write splitting instances.
    • Requests to the domain name address may fail if the standby of a master/standby pair (DCS Redis 4.0, 5.0, or 6.0) is faulty. For higher reliability and lower latency, use read/write splitting instances.