Though we already have an entire chapter on proxy and load balancing techniques Chapter 4, Proxy and Pooling Resources, some of these concepts change slightly in a multi-master context.
Consider the implications of attempting to use simple round-robin query distribution. If our application reconnects for each operation and inserts data into Node A, but then selects from Node B, this is an implicit race condition that may not be satisfied at that specific time.
This can also produce strange effects if the application is stateless and performs SELECT–UPDATE pairs regardless of which node it is communicating with. In the presence of high latency for any reason, this could result in two different sequential incremental updates on the same base value.
This recipe will explain how to alter our previous HAProxy configuration to...