Vertical sharding Granularity

Source: Internet
Author: User
Tags database sharding

The granularity of vertical sharding means that several levels of associated tables are allowed to be placed in a shard when vertical sharding is performed. This problem has a great impact on the application and sharding implementation.

 

The more disconnections, the more affected join operations, the larger the application's compromise, but the simpler the routing for a single table, the less associated with the business, the easier it is to use a unified mechanism for processing. the extreme solution in this direction is to interrupt all connections, and each table is configured with routing rules, which can be automatically processed using a unified mechanism or framework. for a framework such as amoeba, its routing can be routed only through SQL features (such as the ID of a table.

 

Conversely, if the association interrupts less, the join operation is limited, and the application needs to compromise less, but the table routing becomes more complex, the more relevant the business is, the more difficult it is to use a unified mechanism for processing. You need to implement a separate route for each data request. the extreme solution in this direction is: all tables are in a shard, that is, there is no vertical split, so that no association is interrupted. of course, this is very extreme, unless the entire database is very simple and the number of tables is very small.

 

The actual granularity control should be taken into account by combining two factors: "Business closeness" and "table data volume". Generally:

  • If the table is closely linked together, the data volume is not large, and the growth rate is also very slow, it is suitable to put it in a shard without horizontal splitting;
  • If the data volume of a table is large and growing rapidly, it is necessary to perform horizontal segmentation on the basis of vertical segmentation, horizontal sharding means that a single shard will be subdivided into several smaller Shard, and each shard has a primary table (that is, the table with the table ID hashed) multiple associated tables.

In short, the granularity of vertical segmentation shows the coexistence and game of advantages and disadvantages in two opposite directions. what architects need to do is to balance the benefits of the two based on the actual situation of the project.

 

 

Related reading:

Database sharding series (V): sharding scale-up plan database sharding series that supports free planning without data migration and modification of routing code (IV) multi-Data Source transaction processing database sharding series (iii) database sharding series (ii) about the use framework or self-developed and sharding implementation) global primary key generation policy database sharding series (I) sharding implementation policies and examples demonstrate basic ideas and sharding policies for vertical sharding databases in vertical sharding

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.