A new understanding of database level sub-Library and vertical sub-Library

Source: Internet
Author: User

Horizontal sub-Library: When the amount of data is huge, put the data into different tables, such as Table 1, table 2, table 3, ... ;

Vertical Sub-Library: When a table is too many fields, you can split one or more tables, according to the primary key unique indicator;

New Understanding:

Vertical Sub-Library: When there are not many fields in a table, when some words are long and the table takes up a lot of space, it takes a large amount of IO to retrieve the table (the essence of database retrieval is IO access to the files on the hard disk).

At this point, you can consider splitting the long-length field into a single table, with the primary key of the original table uniquely labeled.

Instead:

When the number of database records, but more fields, you can integrate some fields, such as user information (phone, phone number ...) ), saved to the database as a JSON string, at a glance, at the cost of the JSON in the service layer, but more parsing.

How to choose and see the project needs.

A new understanding of database level sub-Library and vertical sub-Library

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.