简体   繁体   中英

How can i take my mysql database into Master Slave configuration for data backup and separation of inserts and selects

I have a huge database almost 5M records and its growing at a high speed. I have a Query for report generation which joins 4 tables and the time it takes is not pretty. I want to replicate my database on a slave instance and separate inserts and select. So when i select data it goes to master and on inserts goes to slave and replicates the data whenever either one is updated. Whats your suggestion on this.

In MySQL terminology, user insertions and updates are directed to the Master, such changes are then forwarded to the Slave (so it is the other way around).

If you want a bi-directional synchronisation, you will need to consider circular replication ( here is a good tutorial).

The next step is clustering , but this is a bit more complex to handle.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM