Horizontal design and longitudinal design in database

Source: Internet
Author: User

Recently in learning database design suddenly be conscious of the understanding of some ideas, horizontal design, vertical design, this is probably to meet the first few paradigms I don't quite understand, but I want to summarize some experience in my own way.

The total well-known data table is a ' row ' and ' column ' composition, then we in the design to take into account the ' ranks ' of the data, the first is not to meet business needs, the second can be extended conveniently, the third can let the program write

Simpler, so this is a problem, it's also a design, the following example:

A piece of data about the student's elective grade:

--------------------------------------------------This is the traditional way of horizontal design

-------------------------------------------------It's a longitudinal design.

OK, suddenly feel that no matter how you want to add your elective, I am not afraid of you, but not that vertical design is invincible

Advantages and disadvantages of transverse design

Li: 1, preselection set up the required columns, easy to operate the database

Disadvantages: 1, not easy to expand, easy redundancy

Advantages and disadvantages of longitudinal design

Li: 1, easy to expand, good elasticity, follow the database design of the XX paradigm (as for the first few, I really do not remember)

Disadvantages: 1, lost control of the data, that is, it is difficult to maintain the standardization of data, if my program is not standardized optional in the elective column to join the ' cooking skills class ', then as I set a good technical school application scenario, this data is the wrong data

2, to manage and operate the longitudinal table is very difficult

In short, in the database design can not blindly pursue the longitudinal design, good elasticity, expand Well, he will be on the database as an unnecessary operation

In the design should pursue the balance, the necessity

Above for personal opinion, the wrong place wants to Haihan and correct.

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.