If you are planning to move to a data-centric approach, there are some things that you must consider that can help you along the way:

  • Referential integrity
  • Check constraints
  • Column-level security
  • Column encryption
  • Automatic key generation
  • Tr i g g e r s 
  • Store procedures

Referential integrity from the start

It is important to start defining the relationships of the tables to ensure database integrity. For example, when you want to add an employee to a database and you must validate the
employee’s department, you can define a rule of referential integrity, which does not permit the addition of the employee record if the department ID is not correct or does not exist in the department table. With this rule, you ensure that there are no employees with the wrong department ID; this rule applies for all interfaces.

Triggers are an outstanding complement

There is business logic that can be implemented with triggers. Defining a trigger is a technique to ensure important business validations.

You might need to include a few validations that are not possible to ensure referential integrity. This situation is when you use triggers, which are the greatest complement to run the validations from the database.

For example, imagine that you want to validate the credit status of one client before acceptingan order. This validation is not possible from referential integrity, but you can create a triggeto insert a delay to determine whether to accept the client order.

When a new order is inserted, a trigger starts and the trigger receives information about the order and the customer. Immediately, an email is automatically sent.

Moving to data-centric programming 1

SQL is the basis

SQL is the basis of data-centric programming. In this programming, SQL works efficiently at processing large sets of data.

All objects of the database are most effective when they are created with SQL.

You should consider creating all objects with SQL because this can improve the data access and performance of the applications.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}