Read/write splitting instances of ApsaraDB for Redis are different from standard instances and cluster instances of ApsaraDB for Redis in terms of architectures and data processing methods. This topic describes how each component of a read/write splitting instance works and provides guidelines about how to use them.

Architecture description

  • A read/write splitting instance of ApsaraDB for Redis provides one or more read replicas.
  • One-way chained replication is used between the master node and the read replicas.
  • A proxy server forwards requests to the master node and read replicas in the following ways:
    • Forwards write requests to the master node.
    • Forwards read requests to the master node and read replicas in an equal-weight manner.
  • Requests from Lua scripts and database transactions are forwarded to the master node.
  • The high-availability (HA) module monitors the statuses of the master node and read replicas and performs a failover if one of the components fails.
Figure 1. Architecture of a read/write splitting instance of ApsaraDB for Redis
Architecture of a read/write splitting instance of ApsaraDB for Redis

Notes

  • If a read replica fails, requests are forwarded to another read replica. If all read replicas are unavailable, requests are forwarded to the master node. Read replica failures may result in increases of the workloads on the master node and the response time. We recommend that you use multiple read replicas to process a large number of read requests.
  • If an error occurs on a read replica, the HA module suspends the read replica and forwards requests to an available read replica. This failover process involves resource allocation, data synchronization, and service loading. The amount of time that it takes to perform a failover depends on the system workloads and data size. ApsaraDB for Redis does not guarantee the time when the faulty read replica recovers.
  • Full synchronization between read replicas is triggered in certain scenarios, for example, when a failover occurs on the master node. During full synchronization, read replicas are not available. If your requests are forwarded to the read replicas, the following error message is returned: -LOADING Redis is loading the dataset in memory\r\n.
  • The master node conforms to the Service Level Agreement of ApsaraDB for Redis.