Distributed Database
Md. Mahedi Hasan
Lecturer, Department of Computer Science and Engineering
North Western University, Khulna
Outline
Concept
Distributed Database Types
– Homogeneous
– Heterogeneous
Distributed Database Design
– Data Fragmentation
– Data Allocation
– Data Replication
Concept
A distributed database (DDB) is a collection of multiple,
logically interrelated databases distributed over a
computer network.
A distributed database management system (D–DBMS)
is the software that manages the DDB and provides an
access mechanism that makes this distribution
transparent to the users.
Distributed database system (DDBS) = DDB + D–DBMS
Functionality
Security
Keeping track of data
Replicated data management
System catalog management
Distributed transaction management
Distributed database recovery
Distributed DBMS
Advantages of D-DBMS
Organizational Structure
Share-ability and Local Autonomy
Improved Availability
Improved Reliability
Improved Performance
Economics
Modular Growth
Disadvantages of D-DBMS
Complexity
Cost
Security
Integrity Control More Difficult
Lack of Standards
Lack of Experience
Database Design More Complex
Types of D-DBMS
Homogeneous D-DBMS
Heterogeneous D-DBMS
Homogeneous D-DBMS
All sites have identical software and are aware of each other and
agree to cooperate in processing user requests.
Much easier to design and manage
The operating system used, at each location must be same or
compatible.
The database application (or DBMS) used at each location must
be same or compatible.
It appears to user as a single system
All access is through one, global schema
The global schema is the union of all the local schema
Homogeneous Database
Heterogeneous D-DBMS
Different sites may use different schema and
software.
Different nodes may have different hardware &
software and data structures at various nodes or
locations are also incompatible.
Different computers and operating systems,
database applications or data models may be used
at each of the locations.
Difficult to manage and design.
Local access is done using the local DBMS and
Typical Heterogeneous Environment
Distributed Database Design
Three key issues:
Data Fragmentation
• Relation may be divided into a number of sub
relations, which are then distributed.
• Breaking up the database into logical units called
fragments and assigned for storage at various
sites.
Data Allocation
• The process of assigning a particular fragment to
a particular site in a distributed system.
Data Replication
• Copy of fragment may be maintained at several
sites.
Distributed Database Design
Data Fragmentation
data can be distributed by storing individual
tables at different sites
data can also be distributed by decomposing a
table and storing portions at different sites –
called Fragmentation
fragmentation can be horizontal or vertical
Why use Fragmentation?
Usage - in general applications use views so it’s
appropriate to work with subsets
Efficiency - data stored close to where it is most
frequently used
Parallelism - a transaction can divided into several sub-
queries to increase degree of concurrency
Security - data more secure - only stored where it is
needed
Disadvantages:
Performance - may be slower
Integrity - more difficult
Distributed Database Design
Data Allocation
Four alternative strategies regarding placement of data
Centralized
Partitioned (or Fragmented)
Complete Replication
Selective Replication
Data Allocation
Centralized
Consists of single database and DBMS stored
at one site with users distributed across the
network.
Partitioned
Database partitioned into disjoint fragments,
each fragment assigned to one site.
Complete Replication
Consists of maintaining complete copy of
database at each site.
Selective Replication
Combination of partitioning, replication, and
centralization.
Distributed Database Design
Data Replication
System maintains multiple copies of data, stored
in different sites, for faster retrieval and fault
tolerance.
Advantages of Replication
Availability: failure of site containing relation r does not
result in unavailability of r is replicas exist.
Parallelism: queries on r may be processed by several nodes
in parallel.
Reduced data transfer: relation r is available locally at each
site containing a replica of r.
Disadvantages of Replication
Increased cost of updates: each replica of relation r must be
updated.
Increased complexity of concurrency control: concurrent updates
to distinct replicas may lead to inconsistent data unless special
concurrency control mechanisms are implemented.
One solution: choose one copy as primary copy and apply concurrency
control operations on primary copy.