Distributed Databases and Client Server Architectures
Distributed Databases and Client Server Architectures
Local applications: These apps may run entirely on the data present at the local
location and do not require data from other sites. For instance, a local
application may consist of producing reports using sales information kept
on−site.
Global Applications: To complete their tasks, global applications need data from
many places. These programs are made to access and work with dispersed
data that is spread across several websites. For instance, a worldwide
application would require compiling data from several regional databases and
analyzing user behavior.
Update: It allows us to modify the existing data in the database. Users can
update or change values in rows and columns both.
Delete: It is used to remove data from the database. Conditions are provided
to delete specific data in a database.
Distributed Processing
A centralized database that is accessible from several locations over a
computer network is referred to as distributed processing. In this case, the
data is still centralized and accessible to other users via the network. The
data is not physically distributed across many sites, hence this is not a
distributed database.
Data Fragmentation: The process of dividing the database into smaller multiple
parts or sub−tables is called fragmentation. The smaller parts or sub−tables
are called fragments and are stored at different locations. Data
fragmentation should be done in a way that the reconstruction of the original
parent database from the fragments is possible.
Duplicate Fragments: The database may contain certain fragments that are
repeated on other websites in specific circumstances. Redundancy enables
fault tolerance and data availability. The data may still be accessible from
another location if one site goes down.
Site Allocation: Within the distributed system, portions of the database are
assigned to certain sites. This allocation is dependent on variables including
network topology, performance requirements, and data proximity.
Data Fragmentation
The process of dividing the database into smaller multiple parts or
sub−tables is called fragmentation. The smaller parts or sub−tables are
called fragments and are stored at different locations. Data fragmentation
should be done in a way that the reconstruction of the original parent
database from the fragments is possible. The restoration can be done using
UNION or JOIN operations.
Horizontal Fragmentation
Example
In this example, we are going to see how the horizontal fragmentation looks
in a table.
Input :
STUDENT
Output
id name age salary
1 aman 21 20000
2 naman 22 25000
id name age salary
4 soman 24 36000
Example
This example shows how the Select statement is used with a condition to
provide output.
Output
id name age salary
1 aman 21 20000
2 naman 22 25000
Example
This example shows how the Select statement is used with the where clause
to provide output.
Output
id name age salary
Vertical Fragmentation
Example
Input Table :
STUDENT
Example
SELECT * FROM name;#fragmentation 1
SELECT * FROM id, age;#fragmentation 2
Output
name
aman
naman
raman
sonam
age
21
22
Example
This example shows how the Select statement is used with the where clause
to provide the output.
Output
name age
naman 22
Data Replication
Data replication means a replica is made i. e. data is copied at multiple
locations to improve the availability of data. It is used to remove
inconsistency between the same data which result in a distributed database
so that users can do their task without interrupting the work of other users.
Transactional Replication
It makes a full copy of the database along with the changed data.
Transactional consistency is guaranteed because the order of data is the
same when copied from publisher to subscriber database. It is used in
server−to−server environments by consistently and accurately replicating
changes in the database.
Snapshot Replication
Merge Replication
Data Allocation
It is the process to decide where exactly you want to store the data in the
database. Also involves the decision as to which data type of data has to be
stored at what particular location. Three main types of data allocation are
centralized, partitioned, and replicated.
Partitioned: The database gets divided into different fragments which are
stored at several sites.
There are two ways in which data can be stored at different sites. These are,
1. Replication.
2. Fragmentation.
Replication
Tier refer to the physical operation of Layer refers to the logical separation
components. of an application.
Tiers are physical separated and Layers are logically separated but
running on the different machines are running on the same servers or the
servers. machines.