Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 3.97 KB

SingleLeaderReplication.md

File metadata and controls

26 lines (18 loc) · 3.97 KB

⭐ Single-Leader replication

Terminologies

Term Description
Leader (also known as master or primary) One of the replicas is designated the leader (also known as master or primary).
- When clients want to write to the database, they must send their requests to the leader, which first writes the new data to its local storage.
Followers (read replicas, slaves, secondaries, or hot standbys) Whenever the leader writes new data to its local storage, it also sends the data change to all of its followers as part of a replication log or change stream.
- Each follower takes the log from the leader and updates its local copy of the data‐ base accordingly, by applying all writes in the same order as they were processed on the leader.

Also known as Leader-Follower, Master-Slave, Primary-Replica replication.

Supported services

This replication is available as a built-in-feature in various technologies.

Type Tech
SQL/Relational Databases Amazon Aurora, PostgresSQL, MySQL etc.
NoSQL Databases Amazon Elastic Cache (Cluster Disabled), Redis - Master Slave Replication, MongoDB, DynamoDB etc.
Message Brokers Kafka Cluster, RabbitMQ

Leader Election Process

  • In case of failed leader, new leader would be chosen through an election process (where the leader is chosen by a majority of the remaining replicas), or by a previously elected controller node.
  • Technologies like Zookeeper service is helpful for coordinating the election process.