Highly Available MySQL Clusters at WePay

Highly Available MySQL Clusters at WePay

Each cluster consists of a master and multiple slaves, where a single MySQL instance (the master) accepts writes. The local HAProxy passes the request to the remote (second tier) HAProxy, which is aware of the current master and its slaves. We store the identities of cluster masters and slaves in the consul KV Store. In our case, consul-template listens to changes in master and slave data using the Consul KV store. When there are master or slave value changes in the consul KV Store, the remote HAProxy identifies the changes through consul template, which updates the config files, and reloads HAProxy with the updates.

Source: wecode.wepay.com