MongoDB is a source-available cross-platform document-oriented database program for high-volume storage. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas.
You can resize existing MongoDB database clusters at any time to add more CPUs, RAM, and storage. To avoid data loss, you cannot decrease the size of database clusters.
Resize a Database Cluster Using the CLI
Note
To resize a database cluster using doctl, you need to provide a value for the --size flag, which specifies the cluster’s new configuration (number of CPUs, amount of RAM, and hard disk space). Use the doctl databases options slugs command to get a list of available values.
How to resize a Database Cluster using the DigitalOcean CLI
To resize a Database Cluster via the command-line, follow these steps:
Use the token to grant doctl access to your
DigitalOcean account.
doctl auth init
Finally, resize a Database Cluster with
doctl databases resize. The basic usage looks
like this, but you'll want to read the usage docs for more details:
To resize a database cluster using the API, you need to provide a value for the size field, which specifies the cluster’s configuration (number of CPUs, amount of RAM, and hard disk space). Use the /v2/databases/options endpoint to get a list of available values.
How to resize a Database Cluster using the DigitalOcean API
To resize a Database Cluster using the DigitalOcean API, follow these steps:
To resize a MongoDB database cluster, click the name of the cluster in the control panel to go to its Overview page, then click the Settings tab.
In the Cluster configuration section, click the Edit button. Select the MACHINE TYPE, NODE PLAN, and the number of STANDBY NODES (optional) for your configuration.
Once you have selected your new configuration, click Save to provision the new configuration. The provisioning takes several minutes but the total time depends on the size of the cluster.
Your cluster’s state changes from Active to Resizing until the process is done. You can expect no downtime and do not need to take action.