0

Is there a way or tool which can help route read and write queries to their respective instances in Aurora Postgres cluster, I got to know about ProxySQL but can it be used with Aurora Postgres?

2
  • Found a solution using Spring's TransactionRoutingDataSource, looks promising but yet to try. Dropping the link here - medium.com/javarevisited/… Commented May 13, 2024 at 7:36
  • One more post explaining solution using same TransactionRoutingDataSource - vladmihalcea.com/… Commented May 13, 2024 at 7:46

1 Answer 1

-1

AWS Aurora (postgres or mysql) will provide you the writer and reader endpoint by default when you create a cluster and have atleast one reader and writer nodes. if you have access to the console, click on the database instance -> connectivity & security --> endpoints section , you would see 2 entries, i.e. writer and reader endpoint. And these endpoints remain static when there is a failover or new nodes being added so the applications can use it without changing them in case of underlying nodes changes. Note that in case of multiple reader nodes , the reader endpoint will connect to reader nodes in round robin fashion.

sample doc to refer : https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Connecting.html

Sign up to request clarification or add additional context in comments.

3 Comments

not sure why there was downvote for it , or what was the expectation here ?
I didnt downvote but with your suggestion do I have to keep two connections, one for each reader and writer endpoint?
yes my suggestion was to make use of the reader and writer endpoints individually as 2 different connections , now i understand that you would like to route your write queries to writer node and select type queries to reader node , yes then proxy sql will be handy here , where in i have a instance hosting the proxy sql, added these 2 endpoints as sql server list and add rules to route the writes and reads to the respective nodes. this link will be a starter for you : proxysql.com/documentation/aws-aurora-configuration @MAlok

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.