Database design that's the thing.

Source: Internet
Author: User

Database design principles, or the ultimate goal:

    • Efficient storage
    • Efficient access

Recently learned some of the theoretical knowledge of the database on the Web (recently I like to start with video ...). It seems to be the video and blog, and now summarized as follows;

Overall structure: Demand analysis-"logical design-" Physical design-"maintenance and optimization;"

In fact, the speaker also believes that database design is a requirement, and the entire design contains the above four steps;

General statement

Direct



Here is the text version

    • Demand Analysis: Analysis of the entire database to save what data, what characteristics of the data, what is the relationship between the data (clear data, clear data characteristics, clear data relationship);
    • Logical design: Build a model/diagram for the data features and relationships in the previous step;
    • Physical design: The design in the previous step is implemented in the database creation;
    • Maintenance Optimization: The database is maintained or optimized according to requirements change and performance change;
Demand analysis

Give me a chestnut:

The above vivid interpretation of how to analyze the database requirements, and then the process of drawing, no longer repeat;

Logic Design

The first is the design of the ER diagram:


Then there are the various paradigms:

    • The first paradigm: each attribute is single and non-detachable;
    • The second paradigm: there is no redundancy in the table, there is no partial function dependency;
    • The third paradigm: there is no transfer function dependency

Do not understand, well, maybe after some time I also can not understand, need some explanation to do:
The answer to the paradigm in the knowledge

There are actually a few points to note:

    • The paradigm will be "backwards compatible";
    • The basic 1 paradigm must be satisfied;
    • Generally meet the BC paradigm can be;
    • For convenience and performance considerations, most of the time the inverse paradigm design is required;

Below:







Physical design

Physical design is mainly to put the need to implement, here is the building of the database table, so it involves the choice of what library, to what specifications to build a table, the table of the problem of how to design the field;

Directly to the conclusion:

    • For Internet projects, please choose MySQL directly;
    • The table structure design should follow 1NF and appropriate inverse paradigm design;
    • Table fields should follow the readability design;
    • Data type selection Please choose the best choice based on business application;
    • The primary key directly with the ID is good;

In a illustrated statement:













On the foreign key, trigger, reservation field of the disabled, you can further study; Of course, the work is in the use of ES, after the next to ponder

Maintenance optimization

Maintenance is optimized for better use of the database, so it can be handled for possible scenarios:

    • Forget the meaning of this field--"Do comment
    • Check table speed Slow--"index maintenance;
    • There's too much data--"split the table.

This piece to say is not much, is the experience, the back has relevant experiences to fill up;








Database design that's the thing.

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.