In the design, we use CHINER Quaternion modeling

one , Database naming requirements

1. Overall requirements

Try to find the named words from the root list , Not in the root list , Instantly update the root word list . Table name and column name are uniformly lowercase .

2.  Table naming conventions

Table name ( System abbreviation _ Module abbreviation _ Table name word )( It may be the abbreviation of the system _ Table name word ) See the requirements of the project
As identification , Table name generally does not exceed 5 English words , Length cannot exceed 30 Characters . The indication must be popular and easy to understand , English words or abbreviations that can express functions . Indicates that all words contained in are singular , for example , use USER instead of USERS.

It is recommended to use the complete words for the words contained in the table , Underline multiple words (_) Connect . If the table name length is too long , Start with the last word , Use abbreviations of the word one after the other . If there is no agreed abbreviation , Before the word 4 Letters .

3.  Column naming conventions

Take meaningful column names , Column names must be popular and easy to understand , English words or abbreviations that can express column functions . Column name generally does not exceed 5 English words , Length cannot exceed 30 Characters , Generally use complete English words , Underline multiple words (_) Connect .

two , Relevant regulations

Alibaba is the mandatory one MySQL Database specification

( one ) Table building protocol

* 【 force 】 A field that represents a yes or no concept , Must use  is_xxx  Named by , Data type is  unsigned tinyint
( 1  Indicates yes ,0  Indicates no ).

explain : If any field is non negative , Must be unsigned.

* 【 force 】 Table name , Field names must use lowercase letters or numbers , Do not start with a number , Prohibit two underscores between only
Number appears . Modification of database field names is costly , Because pre release is not possible , Therefore, the field name should be considered carefully .
Positive example :getter_admin,task_config,level3_name

Counterexample :GetterAdmin,taskConfig,level_3_name

* 【 force 】 Plural nouns are not used in table names .
explain : The table name should only represent the entity content in the table , Number of entities should not be represented , Corresponding to DO  Class names are also singular , Conform to the expression habit .

* 【 force 】 Disable reserved words , as  desc,range,match,delayed  etc. , Please refer to  MySQL  Official reserved words .
* 【 force 】 Primary key index name is  pk_ Field name ; Unique index name is  uk_ Field name ; Normal index name is  idx_ Field name .
explain :pk_  Namely primary key;uk_  Namely unique key;idx_  Namely index  Abbreviation of .

* 【 force 】 Decimal type is decimal, Prohibited use float  and double.
explain :float  and double  When storing , There is a problem of accuracy loss , Most likely when comparing values , Get incorrect results . If the stored data range exceeds decimal 
Scope of , It is recommended to split the data into integers and decimals and store them separately .

* 【 force 】varchar  Is a variable length string , Do not pre allocate storage space , Do not exceed 5000, If the storage length is greater than this value , Define field type as text
, Separate a table , Corresponding with primary key , Avoid affecting the indexing efficiency of other fields .
* 【 recommend 】 It is better to add “ Business name _ Function of table ”. Positive example :tiger_task / tiger_reader / mpp_config
* 【 recommend 】 If the field meaning is modified or the status represented by the field is appended , Field notes need to be updated in time .
* 【 recommend 】 Fields allow for appropriate redundancy , To improve performance , However, data synchronization must be considered . Redundant fields should follow : Fields that are not frequently modified . no varchar  Extra long field , Not to mention text
  field .
Positive example : Commodity category names are frequently used , Short field length , The name is basically unchanged , Class names can be stored redundantly in associated tables , Avoid associative queries .

three , Self understanding

When designing the database, you must get the corresponding requirements documents and prototype pages , There will be entity analysis , Function description , Business description . But sometimes his designs are not always right , You should thoroughly understand the system corresponding to prototype pages and requirements documents , You have to understand the system better than the people who designed the documentation . You have to ask yourself three questions when designing (
1. Where to look ?2. How ?3. Where does it exist ?), We must communicate in time where there are problems and doubts

Technology
©2019-2020 Toolsou All rights reserved,
Dynamic Simple registration login interface HTML+CSS+JQCSS Implement overflow display ellipsis 802.11 CCA and NAV mechanism Programmer refused due to low salary offer,HR become shame , Netizens instantly blew up ..abaqus Value of mass scaling factor _ABAQUS Mass scaling for Java Student information management system console version C Classic topics of language —— Insert a number into the sorted array Computer level 1 multi-point , How many points can I pass the computer test level 1 VINS-Fusion run kitti stereo and stereo+GPS data TS stay vue2 Writing in the project