Suppose I have a Cars database. I have models and models (FK to Makes). I plan for users to track their cars. Each car has an FK for the model. Now I have many users, and I want to partition my database for load balancing. The “Makes” and “Models” tables do not change so much, but they need to be exchanged with skulls. My idea is to use MySQL replication from the main database of brands and models to each subordinate database. My question is: can I safely write to subordinate databases, assuming that I am not writing these tables to the master?
And although there is still something on this issue to ensure that one slave database has the latest data? For example, someone just added “Taurus” and then wants to add their car. Can I guarantee that the slave database that they use has the latest master data?
, , , . , auto_increment , , , , . .
auto_increment
SHOW SLAVE STATUS Seconds_Behind_Master, , . , , . , , , , , Seconds_Behind_Master .
SHOW SLAVE STATUS
Seconds_Behind_Master
,
avilable :
http://erlycoder.com/43/mysql-master-slave-and-master-master-replication-step-by-step-configuration-instructions-
- MySQL
master-slave, , , master . master-master, . , . ( ) . , . MySQL.
Master 1/Slave 2 /etc/my.cnf:
auto_increment_increment= 2 auto_increment_offset = 1
Master 2/Slave 1 /etc/my.cnf:
auto_increment_increment= 2 auto_increment_offset = 2