#sharding writes with #mysql and increment offsets
▻https://hackernoon.com/sharding-writes-with-mysql-and-increment-offsets-48df32379563?source=rss
Sharding Writes with MySQL and Increment OffsetsTL;DRwe shard writes and avoid conflicts using an increment offset on PKseach #data center contains local write serverswe use multi-source replication on read servers so they contain all the data from all data centers, partitioned by monthAt the beginning, things were simpleWe were using MySQL: one master for writing, and a few slaves for reading. Besides replication lag (more on that later), it worked fine. And then you scale. And then it fails! The master is a SPOF — “Single Point Of Failure”.Whether the process failed, the VM crashed, or we had to do maintenance on the server, having only one “master” to write to meant that the service was down for minutes. And this was not acceptable.The first thing we implemented was sharding based on the (...)