Law of large numbers and MySQL static sharding _ MySQL

Source: Internet
Author: User
Law of large numbers and MySQL static sharding bitsCN.com

Law of large numbers and static MySQL sharding

Sharding has two advantages: static and dynamic sharding and static sharding. they are simple, low development costs, and low maintenance costs.

Common static sharding methods include hash functions and modulo operations, but this exposes a disadvantage (PS: There are 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, it is more active than other data.

Moreover, unfortunately, these radical data is distributed to the same shard, and the header is large.

We cannot balance the load by transferring hotspot data

At this time, with the help of the law of big numbers, 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 volume of each shard is small, it is easier to evenly distribute hotspot data to different shards according to the law of large numbers.

Of course, this may cause cross-partition queries, depending on how you tradeoff

BitsCN.com

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.