Database Replication
Database replication is a method to create and replicate multiple copies of the same database in different servers. Database replication helps to serve the users in a different way whenever there is a database downtime for maintenance is planned.
Database replication helps to restore any failures or server faults. Database replication is of two types:
1) Single Master Database replication – The database system will have only one master database and many replication units (slaves) in same or different servers. Whenever a Read from database occurs, the database slaves become active to respond to read action as they also have the copy of the master database. This improves the system response time and availability. Whenever a database write happens, the master database receives and responds to the request and then updating the slaves with the recent log of updates. Slaves acknowledge the recent updates from the master and thus keep itself in sync with the master database always.
Pros:
• Easy to understand and implement
• Complexity doesn’t increase when the number of nodes increases in the system as it has only one master system always
Cons:• Only one master available for the entire group of systems, if the master fails the system cannot perform write operations and hence no more updates to the database could be performed. But the read operations may continue to work for the data on the snapshot of data before the failure.
2) Multi Master Database replication - The database system will have multiple masters in same or different servers. The read or write operation could be performed on any node and the request is responded. If there is a write operation request in any node, the request is rippled through the network to other servers. This type of database replication adds mode cost of implementation and more complexity. Multi Master Database replication causes conflicts due to the operation acceptance at any node for same object. Hence the system should be able to resolve or protect from such conflicts. Two users updating the values of the same record at the same time is a good example of a database conflict.
• Synchronous replication – These are the active process, that actively monitor conflicts and if it finds such conflict actions, it aborts one of the actions before committing the other action.
• Asynchronous replication – These are the lazy replication process, which allows both the actions which create the conflict to occur and later based upon time stamp or other means resolves the conflict.
Pros:• Master nodes are located in several physical sites distributed in the world wide network.
• If one master fails the other master is available to continue without any data loss
Cons:• Resolving conflicts become a complex process when the number of nodes increases.
• Most of the Multi master database replications are asynchronous perform lazy replications, thus they violate the database ACID properties (Atomicity, Consistent, integrated, Durable)
Related posts:
- Database Normalization Normalization is the process of creating and organizing data in...
- Database Trigger Database Triggers are set of actions written in the code...
- Transactional Database Transactional Database has the functionality or an important role required...
- Relational Database Relational Database, the data or information are gathered and arranged...
- What is Database Database is an integrated collection of logically related data or...
No Responses to “Database Replication”
No feedback yet.