Application Datasources for Aurora

0

The marketing of Aurora on all of aws console pages is working.... I've decided to look into Aurora as a replacement for my mySQL database. So I'm just starting to learn about it. I have a question that is talked around in the documentation. But I can't find a precise answer. I understand that there are read-only instances and read/write instances. Obviously, if want to do a simple query, then I should connect to one of the read-only instances. And if I want to do an insert/update/delete type of action, I should connect to the read-write instance. But until now, all of my code has one datasource that connects to 'the' database instance for all SQL calls. Does this mean I have to go into the bowels of my code and now select one of two different datasources depending upon the function of the SQL statement in order to take advantage of the read-only replicas? I 'could' do that in my own code. But I also have several apps other that I don't own. So that is impossible for those apps. Is there any way to just call a single endpoint for all SQL statements and have them route to read-only instances vs. read-write instances based on whether the statement is a query or update? Or do I lose the clustering advantage unless I change the code to route to different endpoints?

Thanks.

Jerry

質問済み 5年前207ビュー
1回答
0

Hi,
it is possible to utilize a 3rd party tool, such as, ProxySQL. You can have a single endoint and define a read/write split based on regex so that the SQL is sent to either the master or to the read replicas.
ProxySQL: https://proxysql.com/#features
Article on creating Read/Write split: https://github.com/sysown/proxysql/wiki/ProxySQL-Read-Write-Split-(HOWTO)
Hope this helps,
-randy

回答済み 5年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ