What Is Database Integrity?
Database integrity (Database Integrity) refers to the logical consistency, correctness, validity and compatibility of the data in the database. Database integrity is guaranteed by a variety of integrity constraints, so it can be said that the design of database integrity is the design of database integrity constraints. Database integrity constraints can be implemented through a DBMS or an application. DBMS-based integrity constraints are stored in the database as part of the schema. The database integrity achieved by the DBMS is designed according to the database design steps, while the database integrity achieved by the application software is incorporated into the application software design (this article mainly discusses the former).
Database integrity
- Database integrity (Database Integrity) refers to the logical consistency, correctness,
- Database integrity
- A good database integrity design first requires
- When implementing database integrity design, there are some basic principles to grasp:
- 1. According to the type of database integrity constraints, determine the system level and method of its implementation, and consider the impact on system performance in advance. In general, static constraints should be included in the database schema as much as possible, while dynamic constraints are implemented by the application.
- 2. Entity integrity constraints and referential integrity constraints are the most important integrity constraints of relational databases. They should be applied as much as possible without affecting the key performance of the system. It's worth the time and space for the ease of use of the system.
- 3 On the other hand, the multi-level triggering of triggers is not easy to control and is prone to errors. When it is necessary to use them, it is best to use a Before-type statement-level trigger.
- 4 In the requirements analysis stage, you must formulate a naming convention for integrity constraints. Try to use meaningful combinations of English words, abbreviations, table names, column names, and underscores to make them easy to identify and remember, such as: CKC_EMP_REAL_INCOME_EMPLOYEE, PK_EMPLOYEE, CKT_EMPLOYEE. If you use the CASE tool, there are generally default rules, which can be modified and used on this basis.
- 5. Test your database integrity in accordance with business rules to rule out conflicts between implicit integrity constraints and impact on performance as early as possible.
- 6. Have a full-time database design team, responsible for database analysis, design, testing, implementation and early maintenance from beginning to end. Database designers are not only responsible for the design and implementation of database integrity constraints based on the DBMS, but also for auditing the database integrity constraints implemented by the application software.
- 7. Appropriate CASE tools should be used to reduce the workload of each stage of the database design. Good CASE tools can support the entire life cycle of the database, which will greatly improve the work efficiency of the database designer, and it is also easy to communicate with users.