DiegoChicken
DiegoChicken

Reputation: 23

AWS RDS Read Replica

I have dotNet core application and it's MySQL RDS database configured in London AWS region, used by UK users.

I now have users connecting from Australia who are experiencing slow performance when using the UK app.

I would like to improve the performance for these users and thinking of creating a Read only replica of the database as 90% of DB activity is read.

How will the application know whether to use the Sydney Read only replica or the London Read/Write ? Does it somehow detect the user is in Sydney and just direct them to the closest ? Or do I also need to spin up a version of my app over there for that to work?

Upvotes: 1

Views: 378

Answers (1)

Deepak Singhal
Deepak Singhal

Reputation: 10864

I have worked extensively on such use cases. You can always use Route53 to re-direct users to any specific endpoints. I am assuming that your users are NOT interacting directly with database. They would be hitting some application end point. For your scenario; you will have to host your application in australia also ( along with read replica). Now, inside application for read queries you will connect to read replica; while for write queries your application will write to UK database. While the application deployed on UK server; will use same UK server for both. All of this is achieved using property files having database URLs. And you deploy in different locations using different property files. This property file will have following:

    For UK: 
readQueries=uk.mysql.master 
writeQueries=uk.mysql.master 

    For Australia:
 readQueries=aus.mysql.read 
writeQueries=uk.mysql.master

I will recommend you to change title of this question to something better which tells the exact problem. Present title is more of a tag.

Upvotes: 1

Related Questions