0

I have provisioned ElasticCache and launched a Redis cache cluster with Enable Replication option selected in Single Availability Zone, now I see three cache nodes under cache cluster as following each having different endpoint like

testrdsrg-001.xx99xx.0001.euw1.cache.amazonaws.com
testrdsrg-002.xx99xx.0001.euw1.cache.amazonaws.com
testrdsrg-003.xx99xx.0001.euw1.cache.amazonaws.com

Also, under Replication Group I see another endpoint which says as

Node Group Details
Primary Endpoint (The node group's primary endpoint)
    testrdsrg.xx99xx.ng.0001.euw1.cache.amazonaws.com

Here is the snap: enter image description here

So, which endpoint actually should I use in my code? the one of three which are in Cache Cluster or Primary Endpoint (The node group's primary endpoint) and why and how does all this replication actually works.

Farmi
  • 369
  • 1
  • 4
  • 17

1 Answers1

2

Your code should connect to the Primary Endpoint for any Read/Write activities. The Primary Endpoint is always a pointer to the primary node.

All nodes may also be addressed directly but those who are replicas are meant to be used for read only operations .

Most information you need can be find in here:

http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Replication.html

Hope this helps.

lucorsel
  • 36
  • 2