Mysql – Binlog format – RDS default

amazon-web-servicesMySQLmysql-replicationrds

By default in MySQL 5.6 default binary logging format is "STATEMENT".
(https://dev.mysql.com/doc/refman/5.6/en/replication-formats.html)

MySQL 5.6 running on RDS has by default format set to "MIXED" though (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.Concepts.MySQL.html). Seems like STATEMENT is not even available.

What is the background behind this discrepancy?

Best Answer

There's no discrepancy. RDS, being a managed service, does not enable every possible configurable value for every configuration parameter.

The architects of RDS chose not to make STATEMENT available as an option for BINLOG_FORMAT, presumably, because they recognize the fact that it has many limitations in a replication environment.

Not all statements which modify data (such as INSERT, DELETE, UPDATE, and REPLACE statements) can be replicated [correctly] using statement-based replication. Any nondeterministic behavior is difficult to replicate when using statement-based replication.

https://dev.mysql.com/doc/refman/5.6/en/replication-sbr-rbr.html#replication-sbr-rbr-sbr-disadvantages

Even if you don't have RDS replicas, the binary log is still used for RDS point-in-time recovery. Without requiring at least MIXED logging, there would be no way for RDS to restore an instance to a point-in-time and have it guaranteed to actually be identical to the original instance at the same point in time. Using MIXED or ROW makes that possible.

Indeed, the more confusing question is why the default value in the official distributions wasn't changed to MIXED back in MySQL 5.1 or 5.5. Using STATEMENT mode is almost always the wrong choice.

Related Topic