Home Database Database Design Database Fragmentation | tutorial computer
Subscribe to Free Computer tutorial, Computer Science Tutorial and Internet Business Tutorial by Email
Database Fragmentation | tutorial computer

DATABASE FRAGMENTATION

Database Fragmentation is the strategy partitions database into disjoint fragments, with each fragment assigned to one site. If data items are located at the site where they are used most frequently, locality of reference is high. As there is no replication, storage costs are low; similarly, reliability and availability are low, although they are higher than in the centralized case, as the failure of a site results in theoss of only that site's data. Performance should be good and communications costs low if the distributionis designed properly. There are so many computer tutorial discussed about database fragmentation but in this article fragmentation is describe more detail

FRAGMENTATION

Database with the large amount of data could very slow performance, distributed database and database fragmentation is the ways to increase the performance. Why fragmentation in database is needed?  how important database design, so the database must be fragmentated, There are some reasons for fragmenting a relational database:

  • Usage. Application work with views rather than entire relations. therefore, for data distribution, it seems appropriate to work with subsets of relations as the unit for distribution.
  • Efficiency. Data is Stored close to where it is most frequently used. in addition, data that is not needed by local applications is not stored.
  • Parallelisme. With fragments as the unit of distribution, a transaction can be devided into several subqueries that operated on fragments. this should increase the degree of concurrency, or parallelism, in the system, thereby allowing transactions that can do so safely to execute in parallel.
  • Security. Data not required by local applications is not stored, and consequently not fragments located at different sites may be slower.

Relational database and RDBMS Concept used for fragmentation design is very complex, the four component to understand when develop and design computer applications for the database fragmentation is must flexible.

The Correctness of fragmentation :

Fregmentation not as easy as our mind to implemented. There are some principle of correctness of fragmentation rules that must be  followed during fragmentation:

  • Complateness. if a relation (R) decomposed into fragment R1, R2,.....,Rn , Each data item that can be found in R must appears in at least one fragment.This rule is necessary to ensure that there is no loss of data during fragmentation.
  • Reconstruction. It must be possible to difine a relational operation that will be reconstruct the relation R from the fragments. This rule ensures that functional dependencies are preserved.
  • Disjointness. If a data  item (di) appears in fragment Ri, than it should not appear in any other fragment. Vertical fragmentation is the exception to this rule, where primary key attributes must be repeated to allow reconstruction. this rule ensures minimal data redundancy.

Types of Database Fragmentation

There are two main types of fragmentation : HORIZONTAL and VERTICAL. Horizontal fragments are subsets of tuples and vertical fragments are subsets of attributes. there are also two type of fragmentation, mixed and derived. Figure below describe form of each fragmentation :

Vertical-database-Fragmentation Horizontal database Fragmentation


Mixed Fragmentation


Horizontal Fragmentation

In database fragmentation, Horizontal fragmentation groups together  the tuples in a relation that are collectively used by the important transactions. A horizontal fragment is produced by specifying a predicate that performs a restriction on the tuples in the relation. It is define using the selection operation of the relational algebra. the selection operation groups together tuples that have some  common property. For example given tables below :

ID_Sal ID_emp ID_Status SALARY
1 001 IKI001 3000
2 001 IKI002 8000
3 001 IKI003 8000
4 002 IKI002 2000
5 002 IKI004 7000
6 003 IKI001 8000
7 004 IKI003 3000

From table above, if we must devided this tables to two predicate which used for fragmentation (become two fragment P1 and  P2).

P1 : Employee which have sallary < 5000

P2 : Employee which have sallary > 5000

Horizontal Fragmentation of P1 is :

ID_SAL ID_emp ID_Status Salary
1 001 IKI001 3000
4 002 IKI002 2000
7 004 IKI003 3000


Horizontal Fragmentation of P2 is :

ID_Sal ID_emp ID_Status Salary
2 001 IKI002 8000
3 001 IKI003 8000
5 002 IKI004 7000
6 003 IKI001 8000


Vertical Fragmentation

Vertical Fragmentation groups together the attributes in a relation that are used jointly by the important transactions. A vertical Fragment is defined using the Projection operation of the relational algebra. below is the example of vertical fragmentation:

Vertical Fragmentation of P3 is :

ID_sal ID_emp ID_status
1 001 IKI001
2 001 IKI002
3 001 IKI003
4 002 IKI002
5 002 IKI004
6 003 IKI001
7 004 IKI003


Vertical Fragmentation of P4 is :

ID_SAL Salary
1 3000
2 8000
3 8000
4 2000
5 7000
6 8000
7 3000


Vertical and Horizontal Fragmentation have describe above. The main concept of fragmentation is for  database design to produce a good peformance and avaibility and usually is used for medium large company which have many brances. The design of fragmentation is base on needed of its operational, this fragmentation is use only if we need it for increase efficiency and if do not have one large and realible centralized server.

DATABASE FRAGMENTATION or PARTITIONED