Part 4 - Guarantee the integrity of data

xiaoxiao2021-03-06  61

Part 4 - Guarantee the integrity of data

1. Force data integrity with constraint rather than business rules

If you handle the needs in accordance with the business rules, you should check the business level / user interface: if the business rules have changed

Chemical, then just need to be updated.

If the demand stems from the need for maintenance data integrity, it is necessary to apply a restriction condition on the database level.

If you really use constraints in the data layer, you have to ensure that there is a way to use the user to understand the reason why the update cannot be confined.

The language notifies the user interface. Unless your field name is very lengthy, the field name is not enough. - Lamont Adams

As long as it is possible, use the database system to implement the integrity of the data. This includes not only the integrity of standardization, but also

Includes the functionality of data. You can also increase the trigger to ensure the correctness of the data when writing data. Don't rely on business level

Ensure data integrity; it cannot guarantee the integrity of the table (foreign bond), so it cannot be strongly added to other integrity rules.

- Peter Ritchie

2. Distributed data system

For distributed systems, you should save all data in each site or to save data in a place in a place.

It is estimated that the amount of data in the next five or 10 years. When you transfer the data to other sites, it is best in the database field.

Set some tags in. New your tags after you receive your data at the destination site. In order to carry out this data transmission, please write down

Your own batch or scheduler runs at a specific time interval instead of transferring data after every day. local

Copy your maintenance data, such as calculation constants and interest rates, setting the version number to ensure that the data is exactly the same at each site.

- Suhair Techrepublic

3. Forced instruction integrity

There is no good way to eliminate it after harmful data into the database, so you should remove it before it enters the database. Excitement

Indicates integrity features of live database systems. This allows the data to be cleaned to force developers to invest more.

Basic error condition.

- KOL

4. Relationship

If there is a multi-pair relationship between the two entities, it is also possible to translate into many-to-many relationships, then you should set it up.

Multiple relationships. From the existing multi-to-one, there are many more relationships than a lot of relationships than one.

- CS Data Architect

5. Adopt view

In order to provide another layer of abstraction between your database and your application code, you can build a specialized for your app

Views don't have to access the data table directly from the application. This is also equal to providing you with more when processing database changes.

free.

Gay Howe

6. Present the data and restore the plan

Consider the data-owned strategy and include your data recovery process in advance during the design process. Using you can release to users / development

Personal data dictionary achieves convenient data identification while ensuring documentation of data source. Write online update to "update query" for

In the future, the data loss can be rescooted.

- KOL

7. Use the storage process to let the system do

Solved a lot of trouble to generate a highly integrity database solution, my team decided to package some

The functional group of associated tables provides a set of regular stored procedures to access each group to speed up the speed and simplify the client code.

hair. During this time, we found that the 3GL encoder sets all possible error conditions, such as the following:

Select cnt = count (*)

From [

]

Where [] =

IF CNT = 0

Begin

INSERT INTO [

]

([])

VALUES ()

End

Else

Begin

End

And a non-3GL encoder is doing this:

INSERT INTO [

] ([])

Values

()

IF @@ error = 2627 - Literal Error Code for primary key constraint

Begin

End

The second program is much simpler, and in fact, we use our functionality to the database. Although I don't like to use embedded

Word (2627). But it can be used in a pre-processed pre-treatment. Database is not just a place where it is stored

Fang, it also simplifies the encoded place.

- a-smith

8. Use lookup

The best way to control data integrity is to limit the selection of users. As long as it is possible to provide a clear value to the user

The list is for its choice. This will reduce the incorrect and mishand of the type of code to provide data consistency. Some public data is particularly suitable

Search: National code, status code, etc.

- CS Data Architect

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

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.042, SQL: 9