MySQL Extensibility architecture Practice N Library to 2N library expansion, 2 to 4, 4 to 8

Source: Internet
Author: User
Tags modulo calculator

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.