Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is Mysql sub-table sub-library?

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces what is Mysql sub-table sub-library, the content of the article is carefully selected and edited by the author, with a certain pertinence, for everyone's reference significance is still relatively great, the following with the author to understand what is Mysql sub-table sub-library.

1. Sub-table

Before dividing the table, we should first choose the appropriate sub-table strategy (which dictionary is the sub-table field and how many tables the data needs to be divided into), so that the data can be evenly distributed in multiple tables and does not affect the normal query. In enterprise applications, org_id (organizational primary key) is often used as a sub-table field, and in Internet applications, it is often userid. After determining the sub-table strategy, when the data is stored and queried, it is necessary to determine which table to look up the data in.

Data table for data storage = contents of sub-table fields% number of sub-tables

two。 Sub-library

Table splitting can solve the problem of reduced query efficiency caused by a large amount of data in a single table, but it cannot improve the quality of concurrent access to the database. In the face of highly concurrent write access, when Master cannot bear high concurrent write requests, no matter how to expand the Slave CVM, it is meaningless. We split the database to improve the writing ability of the database, that is, the so-called sub-database. The sub-library adopts the way of taking the keyword module to route the database.

Database for data storage = content of sub-database field% number of databases

3. Sub-table and sub-library

When the database is faced with massive data storage and high concurrent access at the same time, it is necessary to adopt the strategy of sub-table and sub-database at the same time. General sub-table and sub-database strategies are as follows:

Intermediate variable = keyword% (number of databases * number of tables in a single database)

Library = rounded (intermediate variables / number of data tables in a single database)

Table = (intermediate variable% number of single database data tables)

After reading the above about what is Mysql sub-table sub-library, many readers must have some understanding, if you need to get more industry knowledge and information, you can continue to pay attention to our industry information column.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report