Database design experience

xiaoxiao2021-03-06  18

According to multi-year design experience, I summed up some application system design routines and everyone to discuss discussions, relatively simple, thrown into jade.

Database section:

Every time a new system, after doing the requirements, you always have to design the database. According to the design table structure of the business needs, there must be a certain set. If you don't follow these sets, you will always implement the system, maintenance, The three paradigms on the textbook were abstract, I summed it in the past few years, I feel that the database design is mainly the following types.

Two major types, maintenance and application classes

There are three types of maintenance classes.

The code table program is used to make a hard-encoded table, which typically can define enumerations in the program, the collection type instead of the common design is ID, code, name three fields, which are initialized in the system, no Can clear data

Basic tables in a system, such as employees, departments, departments, such tables, there is still a feature that needs to be classified. Frequently designed is two tables, Table 1 is the entity table, must be the ID, encoding Code, Name Name, Remarks, Remove Signs, the classified table two is the classification table, the role is to classify the entity table, the field has ID, superior encoding, whether the final level, Name, two tables are classified and table two The ID is associated.

The most typical application of the basic table is the design of the department, the department is a tree structure, when designing the table structure, the novice always loves to be a table, bringing many problems, according to the basic table mode design, can avoid

The relational control table combines two basic tables, which has ID, basic table master key ID, basic table two primary key ID. Typical applications are: to save employees and departmental relationships, design is not in the staff table Add a department to associate, but design a staffing relationship with the staff alone

There are two major types of application forms, which is a familiar master-slave list type.

The primary table is designed according to the needs, and the fields of such tables need to review the logo, letters, auditors, operational time, and business process control fields.

The detailed business information of the primary table is saved from the table, and the association is made by the ID of the primary table, often a primary table record associated multiple stroke records

The application table typical application is the storage of various documents in the management system.

About the design of ID, there are two options to choose

The first is self-growth ID, the shape

The second is the GUID type, (recommended in distributed development)

When designing a database of an application system, it is highly recommended to make a conceptual model first, and most of each table can be designed according to the type summarized.

After the design is standardized, the biggest benefit is that in the development program, for these five types, with the object's persistence technology, the general program template can be developed, thereby increasing development efficiency.

Relationship between table design and object design

,

I also summed up experience after I have the opportunity.

,

And everyone to discuss

转载请注明原文地址:https://www.9cbs.com/read-72561.html

New Post(0)