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

posta 5 anni fa208 visualizzazioni
1 Risposta
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

con risposta 5 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande