Database | Amazon ElastiCache for Redis Flashcards
What is Amazon ElastiCache for Redis?
Features
Amazon ElastiCache for Redis | Database
Amazon ElastiCache for Redis is a web service that makes it easy to deploy and run Redis protocol-compliant server nodes in the cloud. The service enables the management, monitoring and operation of a Redis node; creation, deletion and modification of the node can be carried out through the ElastiCache console, the command line interface or the web service APIs. Amazon ElastiCache for Redis supports Redis Master / Slave replication.
Is Amazon ElastiCache for Redis protocol-compliant with open source Redis?
Features
Amazon ElastiCache for Redis | Database
Yes, Amazon ElastiCache for Redis is protocol-compliant with open source Redis. Code, applications, drivers and tools a customer uses today with their existing standalone Redis data store will continue to work with ElastiCache for Redis and no code changes will be required for existing Redis deployments migrating to ElastiCache for Redis unless noted. We currently support Redis 2.8.21, 2.8.22, 2.8.23, 2.8.24 and 3.2.4.
What are Amazon ElastiCache for Redis nodes and shards?
Features
Amazon ElastiCache for Redis | Database
An Amazon ElastiCache node is the smallest building block of an ElastiCache for Redis Cluster deployment. Each node supports the Redis protocol with Amazon’s enhancements and has its own endpoint and port. Multiple types of nodes are supported, each with varying amount of CPU capability, and memory capacity.
A shard is a collection of one or more nodes that is responsible for a partition of the logical key space. Within a shard, a node may exist in isolation or in a primary/replica relationship with other nodes. If there are multiple nodes within a shard, one of the nodes will take on the read/write primary role and all other nodes will take on a read-only replica role.
Does Amazon ElastiCache for Redis support Redis persistence?
Features
Amazon ElastiCache for Redis | Database
Yes, you can achieve persistence by snapshotting your Redis data using the Backup and Restore feature. Please see here for details.
How can I migrate from Amazon ElastiCache for Memcached to Amazon ElastiCache for Redis and vice versa?
Features
Amazon ElastiCache for Redis | Database
We currently do not support automatically migrating from Memcached to Redis or vice versa. You may, however, use a Memcached client to read from a Memcached cluster and use a Redis client to write to a Redis cluster. Similarly, you may read from a Redis cluster using a Redis client and use a Memcached client to write to a Memcached cluster. Make sure to consider the differences in data format, and cluster configuration between the two engines.
Does Amazon ElastiCache for Redis support Multi-AZ operation?
Features
Amazon ElastiCache for Redis | Database
Yes, with Amazon ElastiCache for Redis you can create a read replica in another AWS Availability Zone. Upon a failure of the primary node, we will provision a new primary node. In scenarios where the primary node cannot be provisioned, you can decide which read replica to promote to be the new primary. For more details on how to handle node failures see here.
What options does Amazon ElastiCache for Redis provide for node failures?
Features
Amazon ElastiCache for Redis | Database
Amazon ElastiCache for Redis will repair the node by acquiring new service resources, and will then redirect the node’s existing DNS name to point to the new service resources. Thus, the DNS name for a Redis node remains constant, but the IP address of a Redis node can change over time. If you have a replication group with one or more read replicas and Multi-AZ is enabled, then in case of primary node failure ElastiCache will automatically detect the failure, select a replica and promote it to become the new primary. It will also propagate the DNS so that you can continue to use the primary endpoint and after the promotion it will point to the newly promoted primary. For more details see the Multi-AZ section of this FAWhen Redis replication option is selected with Multi-AZ disabled, in case of primary node failure you will be given the option to initiate a failover to a read replica node. The failover target can be in the same zone or another zone. To failback to the original zone, promote the read replica in the original zone to be the primary. You may choose to architect your application to force the Redis client library to reconnect to the repaired Redis server node. This can help as some Redis libraries will stop using a server indefinitely when they encounter communication errors or timeouts.
Features
Amazon ElastiCache for Redis | Database
How does failover work?
Features
Amazon ElastiCache for Redis | Database
For Multi-AZ enabled replication groups, the failover behavior is described at the Multi-AZ section of this FAQ.
If you choose not to enable Multi-AZ, then if Amazon ElastiCache monitors the primary node, and in case the node becomes unavailable or unresponsive, Amazon ElastiCache for Redis will repair the node by acquiring new service resources, and will then redirect the node’s existing DNS name to point to the new service resources. Thus, the DNS name for a Redis node remains constant, but the IP address of a Redis node can change over time. However, if the primary node cannot be healed (and your Multi-AZ is disabled) you will have the choice to promote one of the read replicas to be the new primary. See here for how to select a new primary. The DNS record of the primary’s endpoint will be updated to point to the promoted read replica node. A read replica node in the original primary’s AZ will then be created to be a read replica in the shard and will follow the new primary.
Are my read replicas available during a primary node failure?
Features
Amazon ElastiCache for Redis | Database
Yes, during a primary node failure, the read replicas continue to service requests. After the primary node is restored, either as a healed node or as a promoted read replica, there is a brief period during which the read replicas will not serve any requests as they sync the cache information from the primary.
How do I configure parameters of my Amazon ElastiCache for Redis nodes?
Features
Amazon ElastiCache for Redis | Database
You can configure your Redis installation using a parameter group, which must be specified for a Redis cluster. All read replica clusters use the parameter group of their primary cluster. A Redis parameter group acts as a “container” for Redis configuration values that can be applied to one or more Redis primary clusters. If you create a Redis primary cluster without specifying a parameter group, a default parameter group is used. This default group contains defaults for the node type you plan to run. However, if you want your Redis primary cluster to run with specified configuration values, you can simply create a new cache parameter group, modify the desired parameters, and modify the primary Redis cluster to use the new parameter group.
Can I access Redis through the Amazon ElastiCache console?
Features
Amazon ElastiCache for Redis | Database
Yes, Redis appears as an Engine option in the ElastiCache console. You can create a new Redis cache cluster with the Launch Wizard by choosing the Redis engine. You can also modify or delete an existing Redis cluster using the ElastiCache console.
Can Amazon ElastiCache for Redis clusters be created in an Amazon VPC?
Features
Amazon ElastiCache for Redis | Database
Yes, just as you can create Memcached clusters within a VPC, you can create Redis clusters within a VPC as well. If your account is a VPC by default account, your Redis clusters will be created within the default VPC associated with your account. Using the ElastiCache console, you can specify a different VPC when you create your cluster.
Is Redis AUTH functionality supported in Amazon ElastiCache for Redis?
Features
Amazon ElastiCache for Redis | Database
Yes, Redis AUTH functionality is available on Amazon ElastiCache for Redis. At the time of Redis cluster creation via the console or command line interface, once you enable encryption in-transit, you can use the Redis AUTH command to provide an authentication token for communication with the Redis cluster.
How do I upgrade to a newer engine version?
Features
Amazon ElastiCache for Redis | Database
You can easily upgrade to a newer engine version by using the ModifyCacheCluster or ModifyReplicationGroup APIs and specifying your preferred engine version for the EngineVersion parameter. On the ElastiCache console, you can select a cluster and click “Modify”. In the “Modify” window select your preferred engine version from the available options. The engine upgrade process is designed to make a best effort to retain your existing data and requires Redis replication to succeed. For more details on that see here.
Can I downgrade to an earlier engine version?
Features
Amazon ElastiCache for Redis | Database
No. Downgrading to an earlier engine version is not supported.
How do I scale up to a larger node type?
Features
Amazon ElastiCache for Redis | Database
You can easily scale up to a larger node type by using the ModifyCacheCluster or ModifyReplicationGroup APIs and specifying your preferred node type for the CacheNodeType parameter. On the ElastiCache console, you can select a cache cluster or replication group and click “Modify”. In the “Modify” window select your preferred node type from the available options. The scale up process is designed to make a best effort to retain your existing data and requires Redis replication to succeed. For more details on that see here.
Can I scale down to a smaller node type?
Read Replica
Amazon ElastiCache for Redis | Database
Moving to a smaller node type is currently not supported.
What does it mean to run a Redis node as a Read Replica?
Read Replica
Amazon ElastiCache for Redis | Database
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.
When would I want to consider using a Redis read replica?
Read Replica
Amazon ElastiCache for Redis | Database
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 do I deploy a read replica node for a given primary node?
Read Replica
Amazon ElastiCache for Redis | Database
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).
Can I create both a primary and read replicas at the same time?
Read Replica
Amazon ElastiCache for Redis | Database
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 do I connect to my read replica(s)?
Read Replica
Amazon ElastiCache for Redis | Database
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 many read replicas can I create for a given primary node?
Read Replica
Amazon ElastiCache for Redis | Database
At this time, Amazon ElastiCache allows you to create up to five (5) read replicas for a given primary node.