MySQL Extensibility architecture Practice N Library to 2N library expansion, 2 to 4, 4 to 8
http://geek.csdn.net/news/detail/52070
58 the same city Shenjian
http://www.99cankao.com/algebra/modulo-calculator.php
Modulo calculator
Extensibility is also a point that architects need to consider when doing database architecture design. First share a 58 of the city very handsome second-level data expansion program. What problem does this solution solve? The original database horizontally cut into n libraries, now to expand into 2N libraries, the solution is this problem.
Start by dividing 2 modulo 0 or 1
Suppose the original is divided into two libraries, assuming the hash of the way to Shard. For example, it is divided into odd and even libraries.
The first step is lifted from the library , and the bottom one is placed from the library (in fact, nothing is done);
The second step modifies the configuration , at this time the expansion is completed , the original is 2 shards, modified configuration into 4 shards, this process has no data migration. The original even part is now two parts, part 0, Part 2, and the odd part is now 1 and 3. 0 Libraries and 2 libraries do not have data conflicts, but only after the expansion of the dual-master availability in a short period of time this feature is lost.
The extension is then divided by 4 modulo, 0,1,2,3
The third step is to do some finishing touches: the old two-master to remove , in order to ensure the availability of new dual-master synchronization , the original has all the data, now only half of the data to serve, we have to remove the redundant data , The end of these three steps can be slowly manipulated afterwards. The whole expansion in the process in the second step to upgrade from the library, modify the configuration is actually the second level completed, very handsome.
The disadvantage of this scheme is only to realize the expansion of N library to 2N library, 2 to 4, 4 to 8, not 2 library to 3 library, 2 library to 5 library.
F
MySQL Extensibility architecture Practice N Library to 2N library expansion, 2 to 4, 4 to 8