简体   繁体   中英

How to keep row in multiple mysql databases in sync? Preferably with doctrine

What is, if there is, a good way to keep a row in to separate databases (possibly on different machines) in sync?

For clarity. I have multiple mysql databases who share a user table with the same schema. There is a "master" database that has it's own unique schema, but contains the user table which contains all user records. Then there are multiple "slave" databases who for the most part share the same schema, that also contains the user table (with the same schema) with stores a subset of user records.

When an update is made to an instance of the user record in any database I want that change propagated to too all instances of that user record in all databases it is in.

I'm using mysql, php5.3, and doctrine 1.2.x for an orm, running on ubuntu VPS servers.

听起来你正在寻找MySQL复制 ,特别是replicate-do-table配置选项,以限制从属数据库只关心来自主服务器的特定表。

不要尝试使用PHP或Doctrine来执行此操作:查看MySQL复制以使从属数据库表与主服务器保持同步

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