Open In App

Data Replication in DBMS

Data Replication is the process of storing data in more than one site or node. It is useful in improving the availability of data. It is simply copying data from a database from one server to another server so that all the users can share the same data without any inconsistency. The result is a distributed database in which users can access data relevant to their tasks without interfering with the work of others. 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. However in data replication data is available at different locations, but a particular relation has to reside at only one location. There can be full replication, in which the whole database is stored at every site. There can also be partial replication, in which some frequently used fragments of the database are replicated and others are not replicated.

Types of Data Replication –



  1. Transactional Replication: In Transactional replication users receive full initial copies of the database and then receive updates as data changes. Data is copied in real-time from the publisher to the receiving database(subscriber) in the same order as they occur with the publisher therefore in this type of replication, transactional consistency is guaranteed. Transactional replication is typically used in server-to-server environments. It does not simply copy the data changes, but rather consistently and accurately replicates each change.
  2. Snapshot Replication: Snapshot replication distributes data exactly as it appears at a specific moment in time and the does not monitor for updates to the data. The entire snapshot is generated and sent to Users. Snapshot replication is generally used when data changes are infrequent. It is a bit slower than transactional because on each attempt it moves multiple records from one end to the other end. Snapshot replication is a good way to perform initial synchronization between the publisher and the subscriber.
  3. Merge Replication: Data from two or more databases is combined into a single database. Merge replication is the most complex type of replication because it allows both publisher and subscriber to independently make changes to the database. Merge replication is typically used in server-to-client environments. It allows changes to be sent from one publisher to multiple subscribers.

Replication Schemes

1. Full Replication: The most extreme case is replication of the whole database at every site in the distributed system. This will improve the availability of the system because the system can continue to operate as long as atleast one site is up.

Data Replication



Advantages of full replication:

Disadvantages of full replication:

No replication

No replication means, each fragment is stored exactly at one site.

Advantages of No replication:

Disadvantages of No replication:

3.Partial replication: Partial replication means, some fragments are replicated whereas others are not. Only a subset of the database is replicated at each site. This reduces storage costs but requires careful planning to ensure data consistency.

Advantages of partial replication:

Features of data replication are:

Increased Availability: Data replication can improve availability by providing multiple copies of the same data in different locations, which reduces the risk of data unavailability due to network or hardware failures.

Improved Performance: Replicated data can be accessed more quickly since it is available in multiple locations, which can help to reduce network latency and improve query performance.

Enhanced Scalability: Replication can improve scalability by distributing data across multiple nodes, which allows for increased processing power and improved performance.

Improved Fault Tolerance: By storing data redundantly in multiple locations, replication can improve fault tolerance by ensuring that data remains available even if a node or network fails.

Improved Data Locality: Replication can improve data locality by storing data close to the applications or users that need it, which can help to reduce network traffic and improve performance.

Simplified Backup and Recovery: Replication can simplify backup and recovery processes by providing multiple copies of the same data in different locations, which reduces the risk of data loss due to hardware or software failures.

Enhanced Disaster Recovery: Replication can improve disaster recovery capabilities by providing redundant copies of data in different geographic locations, which reduces the risk of data loss due to natural disasters or other events.

There are several types of data replication:

  1. Master-slave replication: In this type of replication, one database server is designated as the master, and one or more other servers are designated as slaves. The master server receives all the write operations, and the slaves receive a copy of the data from the master.
  2. Multi-master replication: In this type of replication, all the servers involved in replication can receive write operations, and all the updates made to any server will be replicated to all the other servers.
  3. Peer-to-peer replication: In this type of replication, each server can act as both a master and a slave, and the data is replicated between all the servers in a peer-to-peer fashion.
  4. Single-source replication: In this type of replication, a single source database is replicated to multiple target databases.

The advantages of data replication include:

  1. Improved performance, as data can be read from a local copy of the data instead of a remote one.
  2. Increased data availability, as copies of the data can be used in case of a failure of the primary database.
  3. Improved scalability, as the load on the primary database can be reduced by reading data from the replicas.

The disadvantages of data replication include:

  1. Increased complexity, as the replication process needs to be configured and maintained.
  2. Increased risk of data inconsistencies, as data can be updated simultaneously on different replicas.
  3. Increased storage and network usage, as multiple copies of the data need to be stored and transmitted.
  4. Data replication is widely used in various types of systems, such as online transaction processing systems, data warehousing systems, and distributed systems.

Article Tags :