Yes, MongoDB supports the dynamic addition of secondary nodes. This is one of the key features of MongoDB's replica set architecture, which allows for horizontal scaling and high availability.
When you add a new secondary node to a replica set, MongoDB automatically synchronizes the data from the primary node to the new secondary. This process is called initial sync, and it ensures that the new node has a complete copy of the dataset. After the sync is complete, the secondary node starts receiving updates in real-time through the oplog (operation log).
Suppose you have a MongoDB replica set with one primary and two secondary nodes. If you need to scale out for read-heavy workloads, you can add a third secondary node dynamically:
rs.add() command to include the new instance as a secondary:rs.add("new-secondary-host:27017")
In Tencent Cloud, you can use TencentDB for MongoDB to easily manage replica sets and dynamically add secondary nodes through the console or API, ensuring seamless scalability and high availability.