Previous | Table of Contents | Next |
The key to success with distributed servers is very simple. Start small and phase in new servers only after communications with the existing servers have been debugged. Companies choosing a very large or mission-critical system often get mired in technical problems, unable to deliver a finished system.
The mastery of distributed databases is achieved by doing, not by reading. To understand the issues fully and first hand, do the following exercise. This exercise requires:
Begin with a small existing system which is not mission critical and remove part of the centralized data onto another platform. Assume that we are dealing with a customer-order system running on an Oracle database on a Unix platform. This system is very old and needs replacement, but all components have been fully tested and operational for several years. See from the sample E/R model in Figure 1.5 that the database has five tables:
Figure 1.5 A sample customer-order database.
A huge difference exists in the amount of effort that will be required to migrate the data depending on the architecture of the target system (see Figure 1.6). With a relational target system, extracting the data and reformatting the data for import into other relational tables is relatively simple. Other architectures, such as object or network databases, are far more complicated and require sophisticated load programs.
Figure 1.6 The relative difficulty of moving to new database architectures.
For this example, we simply take the existing CUSTOMER table and export the table from Oracle. Next, we add the table to the new database on another platform using Oracles Import utility. In sum, we have extracted data from a centralized source and created a distributed relational environment. While this exercise may seem trivial and artificial, the industry is moving toward architectures where the data will reside on a multitude of hardware platforms.
Oracle databases allow for the control of business rules with constraints. These Referential Integrity (RI) rules ensure that one-to-many and many-to-many relationships are enforced within the relational schema.
Several types of constraints can be applied to Oracle tables to enforce referential integrity, which include:
Note the distinction between UNIQUE and PRIMARY KEY. While both of these constraints create a unique index, a table may only contain one PRIMARY KEY constraint columnbut it may have many UNIQUE constraints on other columns.
NOTE: Referential integrity usually needs to be double coded, once for the database and again within the application. For example, in a multi-part SQL*Form, you may not become aware of an RI violation until you are many pages into the form and your form attempts to commit.
As previously explained, referential integrity maintains business rules. Relational systems allow control of business rules with constraints, and RI rules form the backbone of relational tables. For example, RI ensures that a row in the CUSTOMER table is not deleted if the ORDER table contains orders for that customer (Figure 1.7).
Figure 1.7 An example of referential integrity.
Previous | Table of Contents | Next |