Scale a MongoDB Cluster Horizontally
DBaaS allows you to scale up and down the number of database replicas. Increased replica count may result in a cluster with improved availability, performance (capacity to handle more data reads), and fault tolerance for upgrades. A new IP address must be provided for each new instance.
To do so, send a PATCH
request with the new instances
count (supported values are: 1, 3):
Endpoint
Use the following endpoint to request the new instance count: https://api.ionos.com/databases/mongodb/clusters/{clusterId}
Request
Response
The patch example takes a previous cluster with one replica and adds two more replicas to it.
The two new IP addresses are added to the connection properties cidrList
, and the instances property receives the total number of replicas.
New servers are provisioned and added one at a time to the pool of replicas, implying an incremental rollout.
Downgrading a cluster follows the same pattern, with replica sets being removed one at a time and the desired replica set is reached.
For more information, see Replica Set Elections.
Last updated
Was this helpful?