Reputation: 526
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.
Upvotes: 3
Views: 2598
Reputation: 334
Let me reiterate the recommendation to use the reader endpoint. Some of the doc links are stale because the Aurora User Guide split off from the RDS User Guide after the initial round of answers. The latest on the reader endpoint is:
The reason not to keep track of reader instances coming and going, a reader instance getting promoted to the writer, etc. is that you could experience complications due to delays in DNS propagation and such. The way to minimize such delays even more is to use RDS Proxy:
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/rds-proxy.html
From the "planning" section:
"RDS Proxy bypasses Domain Name System (DNS) caches to reduce failover times by up to 66% for Aurora Multi-AZ databases. RDS Proxy also automatically routes traffic to a new database instance while preserving application connections. This makes failovers more transparent for applications."
Upvotes: 0
Reputation: 601
You can now connect to all the read replicas on your Amazon Aurora cluster through a single reader end point. Until now, you could use the cluster end point to connect to the primary instance in the cluster or instance end points to direct queries to specific instances on your Aurora cluster.
Reader End Point for Amazon Aurora
Upvotes: 0
Reputation: 2733
You can use read endpoints to load balance read connections between Aurora replicas. Be aware that this only load balances the connections and not queries. Balancing queries would be the responsibility of your application.
As a bonus, if you use read endpoints and have multiple replicas in different availability zones then AWS will failover your read connections in the event of an AZ failure.
Upvotes: 1
Reputation: 66
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.
Upvotes: 1