3 ms·
MySQL actually documents their atrocities: https://dev.mysql.com/doc/refman/8.0/en/replication-sbr-rbr.html https://dev.mysql.com/doc/refman/8.0/en/replication-
by keep_reading 3y ago
MySQL actually documents their atrocities: https://dev.mysql.com/doc/refman/8.0/en/replication-sbr-rbr.html https://dev.mysql.com/doc/refman/8.0/en/replication-sbr-rbr....
Let me TLDR them for you
> Advantages of statement-based replication: Proven technology, can be used as an audit log
> Disadvantages of statement-based replication: INSERT DELETE, UPDATE, and REPLACE may not replicate correctly
Are you getting worried yet?
> Advantages of row-based replication: All changes can be replicated.
> Stored functions execute with the same NOW() value as the calling statement. However, this is not true of stored
procedures.
Wonderful. Also not a problem in Postgres AFAIK because you're replicating the WAL so it doesn't need to execute it locally.
Don't forget about the pitfalls of replicating CREATE USER and ALTER USER in MySQL
https://www.percona.com/blog/what-if-the-user-exists-on-the-replica-and-not-in-the-primary-or-any-other-objects/ https://www.percona.com/blog/what-if-the-user-exists-on-the-...
MySQL has improved things in recent years but this list used to be much larger. Just go look through their bug tracker. It's not something that instills confidence and I need to deploy databases I can trust will not eat my data. I've had too many customers with broken MySQL databases over the years and zero with Postgres.
- samlambert 3y agoStatement based replication is not the default in MySQL.
- evanelias 3y ago> Disadvantages of statement-based replication Statement-based replication is deprecated: https://dev.mysql.com/doc/refman/8.0/en/replication-options-binary-log.html#sysvar_binlog_format https://dev.mysql.com/doc/refman/8.0/en/replication-options-... > Stored functions execute with the same NOW() value as the calling statement. However, this is not true of stored procedures. That's from the "disadvantages of statement-based replication" section, not the row-based replication section. So to recap, the disadvantages you've quoted from the manual are specific to statement-based replication, which is deprecated. > Don't forget about the pitfalls of replicating CREATE USER and ALTER USER in MySQL As mentioned in that Percona blog post, all you need to do is add IF EXISTS / IF NOT EXISTS to your SQL and it solves the problem. Or in MariaDB, you also have the option of CREATE OR REPLACE syntax. Sure, it's a minor footgun for newbies, but not exactly a horrendous problem.