Junior — Middle
What are the advantages and features of database replication that you know?
sobes.tech AI
Answer from AI
Database replication is the process of copying and maintaining data across multiple instances (replicas) to enhance availability, fault tolerance, and scalability.
Advantages and features:
- Increased fault tolerance: when one replica fails, data remains accessible on others.
- Load balancing: read requests can be distributed among replicas, reducing the load on the primary database.
- Fast recovery: in case of failure, switching to another replica can be quick.
- Geographical distribution: replicas can be located in different data centers to reduce latency.
Features:
- Replication can be synchronous (ensuring data consistency but with delays) or asynchronous (faster, but with possible update delays).
- Conflict management and data consistency are required.
Example: in Go, drivers supporting replication can be used to work with databases, directing read requests to replicas and write requests to the master.