Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Aptitude
  • Engineering Mathematics
  • Discrete Mathematics
  • Operating System
  • DBMS
  • Computer Networks
  • Digital Logic and Design
  • C Programming
  • Data Structures
  • Algorithms
  • Theory of Computation
  • Compiler Design
  • Computer Org and Architecture
Open In App
Next Article:
Relation Schema in DBMS
Next article icon

Data Replication in DBMS

Last Updated : 19 Sep, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report

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

Data Replication

Advantages of full replication:

  • High Availability of Data.
  • Improves the performance for retrieval of global queries as the result can be obtained locally from any of the local site.
  • Faster execution of Queries.

Disadvantages of full replication:

  • Concurrency is difficult to achieve in full replication.
  • Slow update process as a single update must be performed at different databases to keep the copies consistent.
    • The data can be easily recovered.
    • Concurrency can be achieved in no replication.
    • Since multiple users are accessing the same server, it may slow down the execution of queries.
    • The data is not easily available as there is no replication.
    • The number of copies of the fragment depends upon the importance of data.
    • To provide a consistent copy of data across all the database nodes.
    • To increase the availability of data.
    • The reliability of data is increased through data replication.
    • Data Replication supports multiple users and gives high performance.
    • To remove any data redundancy,the databases are merged and slave databases are updated with outdated or incomplete data.
    • Since replicas are created there are chances that the data is found itself where the transaction is executing which reduces the data movement.
    • To perform faster execution of queries.
    • More storage space is needed as storing the replicas of same data at different sites consumes more space.
    • Data Replication becomes expensive when the replicas at all different sites need to be updated.
    • Maintaining Data consistency at all different sites involves complex measures.

No replication

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

Advantages of No replication:

  • Concurrency has been minimized as only one site to be updated
  • Only one site hence easy to recover data.

Disadvantages of No replication:

  • Poor availability of data as centralized server only has data.
  • Slow down query execution as multiple clients accessing same server.

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:

  • Number of replicas created for a fragment directly depends upon the importance of data in that fragment.
  • Optimized architecture give advantages of both full replication and no replication scheme.

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.


Next Article
Relation Schema in DBMS

H

Harshita Pandey
Improve
Article Tags :
  • DBMS
  • Misc
Practice Tags :
  • Misc

Similar Reads

  • Data Isolation in DBMS
    In today's era effectively managing volumes of data is crucial, for businesses and organizations. Database Management Systems (DBMS) play a role in this aspect by providing tools to store, retrieve, and manipulate data. However when multiple users are. Their transactions interact with the data simul
    5 min read
  • Data Models in DBMS
    A Data Model in Database Management System (DBMS) is the concept of tools that are developed to summarize the description of the database. Data Models provide us with a transparent picture of data which helps us in creating an actual database. It shows us from the design of the data to its proper im
    8 min read
  • Relation Schema in DBMS
    Relation schema defines the design and structure of the relation or table in the database. It is the way of representation of relation states in such a way that every relation database state fulfills the integrity constraints set (Like Primary key, Foreign Key, Not null, Unique constraints) on a rel
    6 min read
  • Relational Model in DBMS
    The Relational Model represents data and their relationships through a collection of tables. Each table also known as a relation consists of rows and columns. Every column has a unique name and corresponds to a specific attribute, while each row contains a set of related data values representing a r
    11 min read
  • Database Languages in DBMS
    Databases are essential for efficiently storing, managing, and retrieving large volumes of data. They utilize both software and hardware components. The software provides an interface that enables users or applications to interact with the database, while the hardware consists of servers and storage
    10 min read
  • Types of Relationship in Database
    A relationship in a DBMS exists when a variable has a connection with the properties stored in different tables. Such relationships help the organization of entities intertwined with each other, ultimately enabling efficient data processing. They're exhibited usually via keys in a table, which is ei
    4 min read
  • B+ File Organization in DBMS
    Data management is performed by Database Management Systems (DBMS) in a very efficient manner. An important feature of DBMS is file organization, that is how data is structured on storage devices in order to facilitate retrieval and manipulation. Among many file organization methods, B+ file organiz
    5 min read
  • What is Relationship in DBMS?
    A database is a structured data set that is usually electronically written in a computer system and stored as data. With their primary purpose being to maintain, keep, and extract data correctly, databases are important. In many practical situations, data is never an isolated file, and its correlati
    5 min read
  • Denormalization in Databases
    Denormalization focuses on combining multiple tables to make queries execute quickly. It adds redundancies in the database though. In this article, we’ll explore Denormalization and how it impacts database design. This method can help us to avoid costly joins in a relational database made during nor
    6 min read
  • Materialization View in DBMS
    A materialization view is nothing but a snapshot or materialized query table. It is a database object that stores the results of the query table. Materialized views in the Database Management System (DBMS) work as the existing snapshots of the data, reducing the computational overhead. Unlike standa
    6 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences