Amazon ElastiCache for Redis | Read Replica Flashcards

1
Q

Can I scale down to a smaller node type?

Read Replica

Amazon ElastiCache for Redis | Database

A

Moving to a smaller node type is currently not supported.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does it mean to run a Redis node as a Read Replica?

Read Replica

Amazon ElastiCache for Redis | Database

A

Read Replicas serve two purposes in Redis:

Failure Handing

Read Scaling

When you run a node with a Read Replica, the “primary” serves both writes and reads. The Read Replica acts as a “standby” which is “promoted” in failover scenarios. After failover, the standby becomes the primary and accepts your cache operations. Read Replicas also make it easy to elastically scale out beyond the capacity constraints of a single node for read-heavy cache workloads.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

When would I want to consider using a Redis read replica?

Read Replica

Amazon ElastiCache for Redis | Database

A

There are a variety of scenarios where deploying one or more read replicas for a given primary node may make sense. Common reasons for deploying a read replica include:

Scaling beyond the compute or I/O capacity of a single primary node for read-heavy workloads. This excess read traffic can be directed to one or more read replicas.

Serving read traffic while the primary is unavailable. If your primary node cannot take I/O requests (e.g. due to I/O suspension for backups or scheduled maintenance), you can direct read traffic to your read replicas. For this use case, keep in mind that the data on the read replica may be “stale” since the primary Instance is unavailable. The read replica can also be used to restart a failed primary warmed up.

Data protection scenarios; in the unlikely event or primary node failure or that the Availability Zone in which your primary node resides becomes unavailable, you can promote a read replica in a different Availability Zone to become the new primary.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do I deploy a read replica node for a given primary node?

Read Replica

Amazon ElastiCache for Redis | Database

A

You can create a read replica in minutes using a CreateReplicationGroup API or a few clicks of the Amazon ElastiCache Management Console. When creating a cluster, you specify the MasterCacheClusterIdentifier. The MasterCacheClusterIdentifier is the cache cluster Identifier of the “primary” node from which you wish to replicate. You then create the read replica cluster within the shard by calling the CreateCacheCluster API specifying the ReplicationGroupIdentifier and the CacheClusterIdentifier of the master node. As with a standard cluster, you can also specify the Availability Zone. When you initiate the creation of a read replica, Amazon ElastiCache takes a snapshot of your primary node in a shard and begins replication. As a result, you will experience a brief I/O suspension on your primary node as the snapshot occurs. The I/O suspension typically lasts on the order of one minute.

The read replicas are as easy to delete as they are to create; simply use the Amazon ElastiCache Management Console or call the DeleteCacheCluster API (specifying the CacheClusterIdentifier for the read replica you wish to delete).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Can I create both a primary and read replicas at the same time?

Read Replica

Amazon ElastiCache for Redis | Database

A

Yes. You can create a new cache cluster along with read replicas in minutes using the CreateReplicationGroup API or using the “Create” wizard at the Amazon ElastiCache Management Console and selecting “Multi-AZ Replication”. When creating the cluster, specify an identifier, the total number of desired shard in a cluster a read replicas per shard, along with cahe creation parameters such as node type, engine version, etc. You can also specify the Availability Zone for each shard in the cluster.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do I connect to my read replica(s)?

Read Replica

Amazon ElastiCache for Redis | Database

A

You can connect to a read replica just as you would connect to a primary cache node, using the DescribeCacheClusters API or AWS Management Console to retrieve the endpoint(s) for you read replica(s). If you have multiple read replicas, it is up to your application to determine how read traffic will be distributed amongst them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How many read replicas can I create for a given primary node?

Read Replica

Amazon ElastiCache for Redis | Database

A

At this time, Amazon ElastiCache allows you to create up to five (5) read replicas for a given primary node.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What happens to read replicas if failover occurs?

Read Replica

Amazon ElastiCache for Redis | Database

A

In the event of a failover, any associated and available read replicas should automatically resume replication once failover has completed (acquiring updates from the newly promoted read replica).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Can I create a read replica of another read replica?

Read Replica

Amazon ElastiCache for Redis | Database

A

Creating a read replica of another read replica is not supported.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Can I promote my read replica into a “standalone” primary node?

Read Replica

Amazon ElastiCache for Redis | Database

A

No, this is not supported. Instead, you may snapshot your ElastiCache for Redis node (you may select the primary or any of the read-replicas). You can then use the snapshot to seed a new ElastiCache for Redis primary.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Will my read replica be kept up-to-date with its primary node?

Read Replica

Amazon ElastiCache for Redis | Database

A

Updates to a primary node will automatically be replicated to any associated read replicas. However, with Redis’s asynchronous replication technology, a read replica can fall behind its primary cache node for a variety of reasons. Typical reasons include:

Write I/O volume to the primary cache node exceeds the rate at which changes can be applied to the read replica

Network partitions or latency between the primary cache node and a read replica

Read replicas are subject to the strengths and weaknesses of Redis replication. If you are using read replicas, you should be aware of the potential for lag between a read replica and its primary cache node, or “inconsistency”. You can monitor such lag potentially occuring via the “Replication Lag” CloudWatch metric, accessible through both the ElastiCache console and API, as well as those of the CloudWatch service.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do I gain visibility into active read replica(s)?

Read Replica

Amazon ElastiCache for Redis | Database

A

You can use the standard DescribeCacheClusters API to return a list of all the cache clusters you have deployed (including read replicas), or simply click on the “Redis” tab of the Amazon ElastiCache Management Console.

Amazon ElastiCache monitors the replication status of your read replicas and updates the Replication State field to Error if replication stops for any reason. You can review the details of the associated error thrown by the Redis engine by viewing the Replication Error field and take an appropriate action to recover from it. You can learn more about troubleshooting replication issues in the Troubleshooting a Read Replica problem section of the Amazon ElastiCache User Guide. If a replication error is fixed, the Replication State changes to Replicating.

Amazon ElastiCache allows you to gain visibility into how far a read replica has fallen behind its primary through the Amazon CloudWatch metric (“Replica Lag”) available via the AWS Management Console or Amazon CloudWatch APIs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

My read replica has fallen significantly behind its primary node. What should I do?

Read Replica

Amazon ElastiCache for Redis | Database

A

As discussed in the previous questions, “inconsistency” or lag between a read replica and its primary node is common with Redis asynchronous replication. If an existing read replica has fallen too far behind to meet your requirements, you can reboot it. Keep in mind that replica lag may naturally grow and shrink over time, depending on your primary node’s steady-state usage pattern.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do I delete a read replica? Will it be deleted automatically if its primary node is deleted?

Read Replica

Amazon ElastiCache for Redis | Database

A

You can easily delete a read replica with a few clicks of the AWS Management Console or by passing its cache cluster identifier to the DeleteCacheCluster API. If you want to delete the read replica in addition to the primary cache node, you must use the DeleteReplicationGroup API or AWS Management Console.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How much do read replicas cost? When does billing begin and end?

Read Replica

Amazon ElastiCache for Redis | Database

A

A read replica is billed as a standard node and at the same rates. Just like a standard node, the rate per “Node hour” for a read replica is determined by the node class of the read replica – please see Amazon ElastiCache detail page for up-to-date pricing. You are not charged for the data transfer incurred in replicating data between your primary cache node and read replica. Billing for a read replica begins as soon as the read replica has been successfully created (i.e. when status is listed as “active”). The read replica will continue being billed at standard Amazon ElastiCache cache node hour rates until you issue a command to delete it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What happens during failover and how long does it take?

Read Replica

Amazon ElastiCache for Redis | Database

A

Initiated failover is supported by Amazon ElastiCache so that you can resume operations as quickly as possible. When failing over, Amazon ElastiCache simply flips the DNS record for your node to point at the read replica, which is in turn promoted to become the new primary. We encourage you to follow best practices and implement cache node connection retry at the application layer. Start-to-finish, failover typically completes within three to six minutes.

17
Q

Can I create a read replica in another region as my primary?

Read Replica

Amazon ElastiCache for Redis | Database

A

No. Your read replica may only be provisioned in the same or different Availability Zone of the same Region as your cache node primary.

18
Q

Can I see which Availability Zone my primary is currently located in?

Read Replica

Amazon ElastiCache for Redis | Database

A

Yes, you can gain visibility into the location of the current primary by using the AWS Management Console or DescribeCacheClusters API.

After failover, my primary is now located in a different Availability Zone than my other AWS resources (e.g. EC2 instances).