Law of large numbers and static MySQL sharding

Source: Internet
Author: User

The law of large numbers and the MySQL static sharding policy have two advantages: static, dynamic, and static sharding: simple, low development costs, and low maintenance costs common static sharding methods include Hash Functions and modulo operations, but this exposes a drawback (PS: there are still many disadvantages ): this disadvantage is as follows: when static sharding is adopted, we cannot define which shard the data is put into. If there is some data that is more active than other data, and it is not coincidentally, the radical data is allocated to the same shard, at this time, the header is too big. We cannot balance the load by transferring hotspot data. At this time, we use the "Law of big numbers" and what is the "Law of big numbers? In a word, it is as follows: "A large enough sample can almost certainly reflect the real composition of the whole", detailed principles, Google, if the data size of each shard is small, according to the law of large numbers, it will be easier spread hotspot data to different shards. In this case, cross-shard queries may exist, depending on how you perform tradeoff.

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.