It is a type of database replication in which there is a single node that is responsible for handling all write operations. This node is called the leader, and the other nodes are called followers.
When a client makes a write request to the database, the request is sent to the leader. The leader then applies the changes to its copy of the database and sends a notification to the followers. The followers then apply the changes to their copies of the database.
Read requests can be sent to any node, including the leader or the followers. This means that even if the leader is unavailable, reads can still be processed by the followers.
Single leader replication is a simple and efficient way to replicate data. It is also a fault-tolerant design, as the system can continue to operate even if the leader fails.
Here are some of the advantages of single leader replication:
Simple and efficient
Fault-tolerant
Easy to implement
Low cost
Here are some of the disadvantages of single leader replication:
Can be a single point of failure
Can have performance bottlenecks
Not as scalable as other replication methods
Single leader replication is a good choice for applications that need high availability and fault tolerance. It is also a good choice for applications that do not require a lot of scalability.
Some databases that use single leader replication include:
MySQL
PostgreSQL
Oracle
MongoDB
Cassandra
RethinkDB
Leaderless replication is a type of database replication in which there is no single node that is responsible for handling all write operations. Instead, all nodes in the replication group can handle write operations.
This makes leaderless replication more fault-tolerant than single leader replication, as the system can continue to operate even if one or more nodes fail. However, leaderless replication can also be more complex to implement and manage.
Some databases that use leaderless replication include:
DynamoDB
Spanner
ScyllaDB
Vitess
The best type of replication for a particular application will depend on the specific requirements of the application.