How to setup MySQL Master-Slave Replication on magento

Wednesday, April 11, 2012
This is an article to show you ,how you can set MySql Master-slave replication in magento for scalability ,handle failover and performance.
You will have to use Slave database for read (select queries) Operations and Master database for write( insert and update queries).
Make changes in the following config file of magento:
app/etc/local.xml

<default_setup>
<connection>
<host><![CDATA[Master-host]]></host>
<username><![CDATA[user]]></username>
<password><![CDATA[pass]]></password>
<dbname><![CDATA[magentodb]]></dbname>
<active>1</active>
</connection>
</default_setup>