Updated on 2024-10-30 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 3.0 instance is invisible to you. Only the master node provides data read/write operations.

    The standby node of a Redis 4.0/5.0/6.0 basic 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 for 15 to 30 seconds without manual operations to resume stable services.

    • Disconnections and unavailability occur during the failover. The service client should be able to reconnect or retry.
    • After a master/standby failover is complete, the previous faulty master node (then the standby one) will be recovered later. Service access to the previous master node will fail. In this case, configure Redis SDKs. For details, see Connecting to Redis on a Client.
  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 basic 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 3.0 Instances

Figure 1 shows the architecture of a master/standby DCS Redis 3.0 instance.

Figure 1 Architecture of a master/standby DCS Redis 3.0 instance

Architecture description:

  • VPC

    The VPC where all nodes of the instance run.

  • Application

    The Redis client of the instance, which is the application running on the ECS.

    DCS Redis and Memcached instances are respectively compatible with Redis and Memcached protocols, and can be accessed through open-source clients. For examples of accessing DCS instances with different programming languages, see the instance access instructions.

  • DCS instance

    A master/standby DCS instance which has a master node and a replica node. By default, data persistence is enabled and data is synchronized between the two nodes.

    DCS monitors the availability of the instance in real time. If the master node becomes faulty, the standby node becomes the master node and resumes service provisioning.

    The default Redis port is 6379.

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

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

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

Architecture description:

  1. Each master/standby DCS Redis 4.0/5.0/6.0 basic 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 basic 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 basic 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 basic edition 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 basic edition) is faulty. For higher reliability and lower latency, use read/write splitting instances.

Architecture of Master/Standby DCS Redis 6.0 Professional Edition Instances

Figure 3 shows the architecture of a master/standby DCS Redis 6.0 professional edition instance.

Figure 3 Architecture of a master/standby DCS Redis 6.0 professional edition instance
Architecture description:
  • VPC

    The VPC where all nodes of the instance run.

    For intra-VPC access, the client and the instance must be in the same VPC with specific security group rule configurations. For details about how to configure the rules, see How Do I Configure a Security Group?.

  • Application

    The Redis client of the instance, which is the application running on the ECS.

    DCS Redis instances are compatible with Redis, and can be accessed through open-source clients. For examples of accessing DCS instances with different programming languages, see Connecting to Redis on a Client.

  • DCS instance

    A master/standby DCS instance which has a master node and a replica node.

    Master/standby DCS Redis 6.0 professional edition instances support Sentinels. 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?

    The default Redis port is 6379.