MySQL DB as Master for some tables and Slave for others I have 2 DBs - DB1 (back-office) and DB2 (web application). The data needs to be synced between the 2. I'm happy with the idea of full master-master replication and may have to implement it, but really I just want some tables replicated from DB1 (back-office) to DB2 (web application) and other tables replicated from DB2 to DB1. (Some data is too sensitive to be replicated out to DB2 hence I'd use the --replicate-wild-do-table method).
DB1 is updated by internal systems and then DB2 would receive the data to be displayed by a web application, the data considered &quot;read-only&quot;. The web application can collect data via web forms and would put it in its local database DB, and I want that data replicated to DB1 back office server.
SO, can MySQL be a master for some tables and a slave for others? If not, could I do it with Postgres?
Many Thanks
Yes you can. MySQL 5.7 and later support filters for replication which allow you to exclude arbitrary tables:
https://dev.mysql.com/doc/refman/5.7/en/change-replication-filter.html
Caveat: This is a slave-side option, which means that sensitive data will still be in the relay logs on the client side.