Updated on 2022-02-22 GMT+08:00

Replica Set

A replica set consists of a set of mongod processes. It is a collection of nodes that help ensure data redundancy and reliability.

For details about the mongod process, see the MongoDB official document.

A replica set consists of three nodes: primary, secondary, and hidden. The three-node architecture is set up automatically, and the three nodes automatically synchronize data with each other to ensure data reliability.

  • Primary node: Primary nodes are used to process both read and write requests.
  • Secondary node: Secondary nodes are used to process read requests only.
  • Hidden node: Hidden nodes are used to back up data.

You can perform operations on the primary and secondary nodes. If a primary node goes down or becomes faulty, the replica set elects a secondary node as a new primary node and continues normal operations. If there are no secondary nodes available, a hidden node will take over the role of the secondary node to ensure high availability. The following figure shows the replica set architecture.

Figure 1 Replica set architecture
  • You can perform multiple management and control tasks, such as creating instances, changing configurations, and backing up instances. The system flexibly controls and tracks tasks, and manages exceptions based on the operations delivered by you.
  • DDS collects slow query logs and access control logs, recording DB instance running status.
  • You can back up DB instance data and upload it to OBS buckets. Currently, DDS supports automated and manual backup. Automated backups are kept for seven days by default.