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>