Thread: Twin Adapter
View Single Post
  #3 (permalink)  
Old 03-06-2008, 11:16 PM
samguyjones samguyjones is offline
Junior Member
 
Join Date: Mar 2008
Posts: 3
Default Replication

I don't see that the documentation you've helpfully posted is inconsistent with my approach. We're going to do replication exactly as you describe, but it won't do us any good if we're always reading and writing from the master. The documentation itself says I need to change my website code (in this case, Zend Framework):

If the part of your code that is responsible for database access has been properly abstracted/modularized, converting it to run with a replicated setup should be very smooth and easy.

I'm not planning on using PHP to replicate. MySQL will replicated. I want to take the PHP code and "convert it to run with a replicated setup", which, as best I can tell, means setting it to read from slaves and write to the master, as my twin adapter idea does.

Now, if MySQL has its own load balancer that will redirect read requests to slaves and write requests to masters, then, great, I don't have to worry about PHP at all, and I'd need to rethink my approach. This documentation you've posted seems to suggest MySQL doesn't do it, since they're giving us advice on how to rewrite our website code.

Since replication is the way to go, and since replication seems to require something like my twin adapter, the question remains. Has someone already done it, or should I write it?
Reply With Quote