AndreyZ wrote:
You can set up replication on one MySQL server
Yes, I already have replication set up and it is functional.
You can use two connections in your application: one for reading data and another for writing data.
My original post asked how to do this... I already know I have to make separate connections to the master and slave servers.
My question:
Is there a semi-automated way to do *connection switching* with MyDAC components, or do I have to insure my TMyQuery component is initialized with the correct connection prior to SQL execution?
The trouble is that I use a lot of DB grids (DevExpress Quantum Grids) and they can both read and write using my TMyQuery components. I may not have a chance to set the connection correctly if the user edits a record within a grid.
It would be nice if the TMyQuery component could expose 2 connection properties, one for writing (or both R/W) and another for just reading. Perhaps the TMyQuery component can decide which connection to use, based on the type of query?
Maybe this could be better done through an Update component connected to a TMyQuery?