Data Replication
1. Overview
- Definition: Database replication refers to the process of sharing or copying data and database objects from one database to another and synchronizing between databases for consistency.
- Types of Replication:
- Master-Slave Replication: One master database handles write operations while one or more slave databases handle read operations.
- Multi-Master Replication: All nodes can act as both a master and a slave, allowing read and write operations across multiple nodes.
- Snapshot Replication: Data is copied at specific intervals to capture the state of the database at that time.
- Transactional Replication: Data changes are replicated in real-time as transactions are committed on the master database.
- Use Cases:
- Disaster recovery: Creating backups in different locations to ensure durability.
- Load balancing: Distributing read queries across multiple replicas to improve performance.
- Data localizing: Placing data closer to users or applications to reduce latency.
- Challenges:
- Latency: Time delay in data synchronization between replicated databases.
- Conflict Resolution: Handling discrepancies in data changes across different replicas, especially in multi-master setups.
- Complexity: Increased architectural complexity in managing replication topologies.
Tags::cs:database: