Posted by akhan on September 17, 2011 at 12:55pm
Hello,
We are setting up a server farm on EC2 to host a site built on Drupal 6. I am reaching out to the this community to seek help in setting up the MySQL master-slave replication where Drupal will write to the mast DB and read from the slave DB. Has anyone done this successfully on EC2?
We are using Scalr.net as the front end cloud application and its lets you set-up the MySQL master-slave instances quite easily. Where I need help is how to tell Druapl to write to the master DB and read from the slave.
Many thanks for help in advance.
Regards,
Arshad
Comments
I believe it's not possible
I believe it's not possible with Drupal 6, or at least without patching the core and many modules heavily.
It's due to the fact that Drupal 6 uses db_query() function with doesn't distinguish INSERT and SELECT.
In order to improve that situation, Drupal 7 changed the DB layer and have db_insert() and db_select() functions for writes and reads. So it might be better to try Drupal 7 if you do need to have master / slave setup.
Oh I see. I thought one would
Oh I see. I thought one would be able to do this.
This would require us to upgrade to D7 which we can't do just now. And when we upgrade to D7, probably the best would be to upgrade to Press Flow 7?
Many thanks for your help.
Arshad
There is no such thing as
There is no such thing as Pressflow 7, but you can easily send reads to the slave on Pressflow 6. And with a bit of trickery you can set specific views to read from the slave as well:
http://www.lullabot.com/articles/querying-slave-database-with-views
--
Dave Hansen-Lange
Director of Technical Strategy, Advomatic.com
Pronouns: he/him/his
Pressflow 7 is alive -
Pressflow 7 is alive - https://github.com/pressflow/7. Not much info yet.
Replication