DHANALAKSHMI COLLEGE OF ENGINEERING
DISTRIBUTED
DATABASES
[Link] ASSISTANT PROFESSOR
CSE(CS)
DHANALAKSHMI COLLEGE OF ENGINEERING
[Link] ASSISTANT PROFESSOR
CSE(CS)
DHANALAKSHMI COLLEGE OF ENGINEERING
● A distributed database is basically a database that is not limited to one system, it is spread over
different sites, i.e, on multiple computers or over a network of computers.
● A distributed database system is located on various sites that don’t share physical components.
● This may be required when a particular database needs to be accessed by various users globally. It
needs to be managed such that for the users it looks like one single database.
[Link] ASSISTANT PROFESSOR
CSE(CS)
DHANALAKSHMI COLLEGE OF ENGINEERING
Data may be stored on several places in two ways using distributed data storage:
● Replication
● Fragmentation.
Replication - With this strategy, every aspect of the connection is redundantly kept at two or more
locations. It is a completely redundant database if the entire database is accessible from every location.
Systems preserve copies of the data as a result of replication. This has advantages since it makes more
data accessible at many locations.
Data replication encompasses the duplication of transactions on an ongoing basis so that the
replicate is in a consistently updated state and synchronized with the source.
[Link] ASSISTANT PROFESSOR
CSE(CS)
DHANALAKSHMI COLLEGE OF ENGINEERING
[Link] ASSISTANT PROFESSOR
CSE(CS)
DHANALAKSHMI COLLEGE OF ENGINEERING
Importance of Database Replication
Database replication is important for several reasons:
● High Availability: Data availability is guaranteed by replication, even in the event that one or more
servers fail. Applications can continue to run uninterrupted by keeping copies of their data on several
servers.
● Disaster Recovery: In the case of a disaster, replication offers a way to restore data. After a disaster,
businesses can quickly resume operations by keeping copies of their data in many locations.
● Load Balancing: It allows for distributing read queries across multiple servers, reducing the load on
any single server and improving performance.
● Fault Tolerance: It improves fault tolerance by ensuring that if one server fails, another can take over
with minimal disruption.
● Scalability: It can improve scalability by allowing for the distribution of write operations across
multiple servers, reducing the load on any single server.
● Data Locality: It can be used to bring data closer to users, reducing latency and improving the user
experience.
[Link] ASSISTANT PROFESSOR
CSE(CS)
DHANALAKSHMI COLLEGE OF ENGINEERING
How does Database Replication works?
Here are the steps explaining how database replication works:
● Step 1: Identify the Primary Database (Source): A primary (or master) database is chosen as the main
source of truth where data changes originate.
● Step 2: Set Up Replica Databases (Targets): One or more replicas (or secondary databases) are
configured to receive data from the primary database.
● Step 3: Data Changes Captured: Any updates, inserts, or deletes in the primary database are recorded,
typically through a transaction log or change data capture mechanism.
● Step 4: Transmit Changes to Replicas: The captured changes are sent to replica databases over the
network in real-time or at scheduled intervals.
● Step 5: Apply Changes on Replicas: The replicas apply these updates to keep their data in sync with
the primary database.
● Step 6: Monitor and Maintain Synchronization: The system ensures replicas stay up-to-date and
handles issues like delays or conflicts during synchronization.
● Step 7: Read or Write Operations: Applications can read data from replicas (to reduce load on the
primary) and may write to the primary, depending on the replication model (e.g., Master-Slave,
[Link] ASSISTANT PROFESSOR
Master-Master).
CSE(CS)
DHANALAKSHMI COLLEGE OF ENGINEERING
Fragmentation –
In this approach, the relations are fragmented (i.e., they’re divided into smaller parts) and each of
the fragments is stored in different sites where they’re required. It must be made sure that the
fragments are such that they can be used to reconstruct the original relation (i.e, there isn’t any
loss of data).
Fragmentation is advantageous as it doesn’t create copies of data, consistency is not a problem.
Fragmentation of relations can be done in two ways:
● Horizontal fragmentation – Splitting by rows –
The relation is fragmented into groups of tuples so that each tuple is assigned to at least one fragment.
● Vertical fragmentation – Splitting by columns –
The schema of the relation is divided into smaller schemas. Each fragment must contain a common
candidate key so as to ensure a lossless join.
[Link] ASSISTANT PROFESSOR
CSE(CS)