Database design experience - sit on the floor today, tomorrow when the boss

1. Some design issues:

The first reason is a permissions issue

       If you do not assign different user specified role, it may have certain rights we do not want to modify the modified data, resulting in data in the database chaos; also, or have access to other tables, to be able to access the programmer does not want to be accessible to the user data.

       Therefore permissions problem is to design a database very noteworthy point.

The following provides a specific method:

At the time of registration, according to the user's registration information, identify (determine) what the user should have this privilege, and insert a line in the registry, while the use of triggers to insert rows authorize or assign roles.

Second, note data redundancy problem, which is still better to do, point this class the teacher is the most important database design, program performance to a large extent and this indirectly associated with the data in the database the more basic operations on the data becomes slower, when a large amount of data stored in the database and a large number of data redundancy, in response to applications will slow down, resulting in a poor user experience of the application.

Finally, in the design of the database, need to demand the application of the design, rather than just storing the data required for the application. Sometimes in order to facilitate the design of the application, the necessary data redundancy is understandable.

2. The database process:

(1) to list all of the properties (the entity (type), property, contact)

(2) determines that each attribute is part of an entity      

(3) the connection between the entities and the entity [1: 1, 1: n, n: 1, n: n]

(4) design-related data tables, allowing data redundancy (sacrifice in exchange for space efficiency), but there must be no contradiction [between engineering and theoretical considerations] between data items   

(5) When there are multiple ways for data processing should be more comprehensive aspects, be considered to select the most suitable solution to the current project [theory is not necessarily the best, but it is suitable for practical]

3. The final table structure is established:

 

(1) staff table: Staff divided into two categories. One is the administration manager, is responsible for the database and other data. The other is the ordinary people, only viewing statistical analysis of data. The main table records the basic information of the staff. Including the number, password, name, sex, age, home address, permissions, and so on telephone, telephone login account.

 

(2) permission on the table: This table stores different people have rights. Table type property rights, rights content. No permission which the primary key.

 

Where the staff table and the table is many-to-authority relations. That is, a permission may correspond to a plurality of users, and a user corresponds to only one kind of rights.

 

(3) the sensor information table: the sensor information table including sensor ID, sensor type, sensor capacity, and prevent Place, replacement date, the table is mainly convenient for sensor maintenance work (such as repair, replacement, upgrades, etc.).

 

(4) the sensor distance table: This table records the distance between the sensors, the first attribute data for the number of sensor number after the starting point, the end point sensor number, spacing, backup.

 

(5) Table Speed: primarily for storing various sensors on the vehicle speed recorded at different times. The total of three attributes table, respectively, the number of sensors, time, speed. Each row represents a sensor for detecting the average speed of the vehicle through all the sensors in a certain period of time. Table whole data recorded total of nearly four months, and therefore comprises a sensor data line 34272.

 

(6) parameters: This table records the data into the data base by the sensor to a final statistics process. Properties are:

 

ID, batch_size, epochs, learning_rate, max_diffusion_step, rnn_units, cl_decay_steps other data. Wherein the ID-based key.

 

(7) the maintenance record sheet sensor: the sensor comprises a maintenance service record table record number, sensor number, maintenance personnel number, maintenance time, cause of the malfunction, wherein the maintenance record number as a primary key.

 

(8) the maintenance staff information table: This table is mainly basic information maintenance staff. Property number, name, sex, age, telephone, address, in which maintenance personnel number as the primary key.

 

(Note: Each table added a backup attribute for future changes to the database)

 

 

Guess you like

Origin www.cnblogs.com/haha-403/p/11823767.html