LaVOZs

The World’s Largest Online Community for Developers

'; amazon web services - Connecting to AWS ElastiCache replication group read replicas - LavOzs.Com

When working with a replication group for AWS-ElastiCache-Redis, is there a way to specify a preference to connect to a read replica?

The goal would be to provide read-only access.

In the other direction, it's easy to prefer to connect to the primary node in a way that remains consistent even if that switches.

From the docs:

For read-only activity, applications can connect to any node in the replication group. However, for write activity, we recommend that your applications connect to the primary endpoint for the replication group instead of connecting directly to the primary node. This will ensure that your applications can always find the current primary node, even if you decide to reconfigure your replication group by promoting a read replica to the primary role.

There is not.

One set of solutions relies on DNS to connect to the instances with the "preferred" master as the least-favored connection and simply check the status of the instance one has connected to. Due to promotions, this is not a guarantee.

slave-allow-chaining, which "[d]etermines whether a read replica in Redis can have read replicas of its own." is currently required to be "no".)

As of June 2019, there is. AWS calls these "reader endpoints" and they function exactly as one would expect.

Related
Scaling Up an Elasticache Instance?
Failing over with single Replication Group on ElastiCache Redis
Connect to ElastiCache cluster via Node.js
AWS Elasticache Redis failover
Enable cluster mode on AWS ElastiCache Redis cluster
How to infer reader endpoint address from aws_elasticache_replication_group with cluster mode disbaled