Mysql – Help with Galera Cluster Auto_Increment

amazon ec2galeramariadbMySQL

We're currently running a Galera cluster of 3 DB nodes. The way we're set up (due to ORM and automagical locking), we only have one of the 3 DB nodes being written to, and the other two provisioned for reads.

Galera's set to auto_increment on a value of 3, since there are three nodes in the cluster, in order to ensure that auto_increment values across the cluster are always unique. See this article (this is a Galera default) – https://blog.mariadb.org/auto-increments-in-galera/

If we plan to always only have 1 write DB, would it be dangerous or risky to set auto_increment to 1 globally across the cluster?

Best Answer

Each node defines auto increment equal to the total number of nodes. This is for avoiding id collisions, because each node in the cluster have their unique sequence of numbers.

Like @jersten said, let galera handle it ;)