Menu
Amazon ElastiCache
User Guide (API Version 2015-02-02)

Redis Replication

Redis now implements replication in two ways: 1) Redis (cluster mode disabled) with a single shard that contains all of the cluster's data in each node, and 2) Redis (cluster mode enabled) with data partitioned across up to 15 shards.

Redis (cluster mode disabled)

A Redis (cluster mode disabled) cluster is a collection of Redis nodes, with one primary read-write node and up to five secondary, read-only nodes, which are called read replicas. Each read replica maintains a copy of the data from the cluster's primary node. Asynchronous replication mechanisms are used to keep the read-replicas synchronized with the primary. Applications can read from any node in the cluster. Applications can write only to the primary node. Read replicas improve read throughput and guard against data loss.

Image: Redis cluster with replica nodes

Redis cluster with replica nodes

You can use Redis (cluster mode disabled) clusters with replicas to scale your Redis solution for ElastiCache to handle applications that are highly read-intensive or to support large numbers of clients that simultaneously read from the same cluster.

All of the nodes in a Redis (cluster mode disabled) cluster must reside in the same region. To improve fault tolerance, you can provision read replicas in multiple Availability Zones within that region. When you add a read replica to a cluster, all of the data from the primary is copied to the read replica. From that point, whenever data is written to the primary, the changes are asynchronously propagated to all the read replicas. Your applications can connect to a read replica and access data in the cluster, although they cannot write any data to a replica.

To improve fault tolerance and reduce write down time, implement Multi-AZ with automatic failover for your Redis cluster with replicas. For more information, see Replication: Multi-AZ with Automatic Failover (Redis).

You can change the roles of the nodes within the cluster, with the primary and one of the replicas exchanging roles. You might decide to do this for performance tuning reasons. For example, with a web application that has heavy write activity, you can choose the node that has the lowest network latency. For more information, see Promoting a Read-Replica to Primary.

Redis (cluster mode enabled)

A Redis (cluster mode enabled) cluster is comprised of from 1 to 15 shards (API/CLI: node groups). Each shard has a primary node and up to five secondary, read-only nodes, which are called read replicas. Each read replica maintains a copy of the data from the primary. Asynchronous replication mechanisms are used to keep the read-replicas synchronized with the primary. Applications can read from any node in the cluster. Applications can write only to the primary nodes. Read replicas enhance read scalability and guard against data loss. Data is partitioned across the shards in a Redis (cluster mode enabled) cluster.

Applications use the Redis (cluster mode enabled) use clusters configuration endpoint to connect with the nodes in the cluster. For more information, see Finding Your ElastiCache Endpoints.


               Image: Redis (cluster mode enabled) cluster with replica nodes

Redis (cluster mode enabled) cluster with replica nodes

All of the nodes in a cluster must reside in the same region. To improve fault tolerance, you can provision both primaries and read replicas in multiple Availability Zones within that region. Your applications can connect to a read replica and access data in the cluster, although they cannot write any data to a replica.

Multi-AZ with automatic failover is required for Redis (cluster mode enabled) cluster. For more information, see Replication: Multi-AZ with Automatic Failover (Redis).

Currently, in Redis (cluster mode enabled), there are some limitations.

  • You cannot promote any of the replica nodes to primary.

  • Multi-AZ with automatic failover is required.

  • The structure of the cluster, node type, number of shards, and number of nodes, is fixed at the time of creation and cannot be changed.