We introduced various design alternatives in the last chapter. We will study the strategies that help in the adopting of the designs in this chapter. It is possible to split the strategies broadly into replication and fragmentation. A combination of the two is, however, used in most cases.
The method of storing separate copies of the database at two or more sites is data replication. It is a popular distributed database fault tolerance technique.
Advantages of Data Replication
Disadvantages of Data Replication
Such widely used methods of replication are –
The process of dividing a table into a number of smaller tables is fragmentation. The table's subsets are called fragments. There can be three kinds of fragmentation: horizontal, vertical, and hybrid (horizontal and vertical combination). It is further possible to divide horizontal fragmentation into two techniques: primary horizontal fragmentation and derived horizontal fragmentation.
In order for the original table to be reconstructed from the fragments, fragmentation should be done in a way. This is required so that the original table can be reconstructed whenever necessary from the fragments. This requirement is referred to as "reconstructiveness."
Advantages of Fragmentation
Disadvantages of Fragmentation
The fields or columns of a table are grouped into fragments during vertical fragmentation. Each fragment should contain the primary key field(s) of the table to preserve reconstructiveness. To implement information privacy, vertical fragmentation can be used.
For example , let us consider that in a student table with the following schema, a university database keeps records of all registered students.
Now, the fees details are maintained in the accounts section. In this case, the designer will fragment the database as follows −
CREATE TABLE STD_FEES AS SELECT Regd_No, Fees FROM STUDENT;
Horizontal fragmentation classifies the table's tuples according to the values of one or more fields. The reconstructiveness rule should also be verified by horizontal fragmentation. Each horizontal fragment must contain all of the original base table columns.
In the student scheme, for example, if the records of all computer science students need to be retained at the School of Computer Science, the designer will fragment the database horizontally as follows.
CREATE COMP_STD AS SELECT * FROM STUDENT WHERE COURSE = "Computer Science";
A combination of horizontal and vertical fragmentation methods are used in hybrid fragmentation. This is the most flexible technique of fragmentation because fragments with minimal extraneous information are generated. Reconstruction of the initial table, however, is always a costly task.
It is possible to do hybrid fragmentation in two alternative ways: