$linuxjunkies
>

replica set

also: replica, replication set, replica cluster

A replica set is a group of database instances that maintain identical copies of data, with one primary node handling writes and secondary nodes serving reads and providing failover redundancy.

A replica set is a distributed database architecture pattern where multiple database servers (replicas) synchronize and maintain the same dataset. One node designated as the primary accepts all write operations, while secondary nodes automatically replicate those changes and can serve read requests.

When the primary fails, the replica set automatically elects a new primary from the available secondaries through a consensus mechanism, ensuring high availability without manual intervention. This is commonly used in MongoDB and other modern databases.

Example: A three-node MongoDB replica set might have one primary accepting writes and two secondaries continuously syncing data. If the primary becomes unavailable, the secondaries hold an election to choose a new primary, keeping the database operational.

Related terms