How to Set Up RDS Proxy for Read/Write Splitting?

April 19, 2025 3 answers
Asked by !wear the goggles
Hey, RDS pros! I've recently taken over a workload that uses Aurora MySQL on RDS. I've noticed something strange: my setup has two nodes (one reader, one writer), but the reader isn't getting any trafficโ€”it's just sitting there with high memory and low CPU usage (only 9%). The proxy is set up with one endpoint for both reading and writing, yet it doesn't seem to balance the load as expected. I'm looking for advice on how to better utilize the reader. Should I: 1) Create a new proxy endpoint just for read-only queries and tell the developers to use that for SELECT operations? 2) Set up a second proxy with the 'Add reader endpoint' option enabled and guide developers to use that for SELECT queries? What do you think would work best?

Answers

hinge...squeaks
Remember that a proxy isn't a load balancerโ€”it's more like a funnel for your requests. If your proxy is only being used for read operations, it might be better to set up a dedicated read endpoint. However, if your workload also needs to write, the existing setup isn't necessarily a problem unless you really need to separate everything out.
Reply to this answer
asterisk-free
You're right that you can't balance writes. If your transactions need both read and write capabilities, they have to go to the writer. The ideal setup would have the RDS proxy configured with distinct endpoints directing to both reader and writer instances. Just make sure your code uses the right endpoint depending on whether it's a read or write operation.
Reply to this answer
spare syllables
I get your worry about failoverโ€”which is a valid concern. But don't fret too much! Aurora automatically manages this for you with its writer and reader endpoints. When a promotion occurs, your application just needs to be aware of potential dropped connections. Implementing logic to handle reconnects or errors is key. Check out the AWS docs for more info on how these endpoints work.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions