Search code examples
amazon-web-servicesamazon-rdsamazon-aurora

Connecting App To an Amazon Aurora RDS Instance


I was reading through the AWS RDS documentation, and found out that there are a multitude of endpoint options that can be used when connecting applications to an Aurora cluster. You can connect through the cluster endpoint, primary endpoint, or to a replica endpoint.

My question is, if I use the cluster endpoint, will I be able to take advantage of read scaling or is that only going to hit the primary instance for reads?

If that doesn't work, I guess the alternative would be to randomly select a read replica when doing a read, or have a load-balancer in front of the replicas and just use it's address for reads.

Please advise as to what is the correct approach if the cluster endpoint doesn't scale read work loads. I am using an ORM framework that will control data access interaction with the Aurora DB cluster.


Solution

  • I just recently had the same question and found that Amazon designed Aurora to only scale reads by using multiple read endpoints. The cluster endpoint points to the primary instance and appears to be the only way to write to the aurora instance. You'd have to split the request types in the application or it may be possible to accomplish something like this with a proxy.

    Docs: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Connect.html

    The cluster endpoint connects you to the primary instance for the DB cluster.