The idea of serverless computing has recently been extended to databases. Serverless databases share many of the same characteristics of serverless application platforms:
- Elastic scaling: The ability to automatically scale up and down based on workload, including the ability to scale down to zero compute resources when there is no workload. Unlike serverless application platforms, which only manage compute, serverless database platforms have both a compute layer and a storage layer which can scale elastically.
- Consumption-based pricing: A pricing model that only charges for the data stored in the database and the resources used to service the database workload.
These attributes confer advantages similar to the serverless application model:
- You don’t need to think about scaling up to meet increasing workloads or storage needs.
- You don’t need to worry about paying for resources you are not using.
Serverless instances are a new database deployment on Atlas, currently available in preview. With serverless instances, Atlas provides the resources you need to build a great application on-demand removing the need to manually scale up or down and only charges for the compute and storage resources you use.
Serverless instances run on the latest MongoDB version with automated upgrades and provide you with up to 1TB of storage, daily backups, performance optimization suggestions, and end-to-end encryption.
Serverless instances are currently available in preview, meaning they are not yet feature-complete or recommended for production use for high-traffic applications at this time. New features will be added incrementally, but you may notice some limitations during this phase. Learn more →
Serverless instances and clusters are two different types of database deployments available on MongoDB Atlas. The main differences include:
|Configuration & Resource Planning||Serverless instances require minimal configuration - you only need to choose a cloud provider/ region to create a serverless instance.||Dedicated and shared clusters require you to determine a cluster tier depending on the level of storage and CPU you require along with offering a variety of further configuration options.|
|Scaling||With serverless instances, MongoDB Atlas will seamlessly provide the database resources your application needs at any given time, removing the need to manually scale up and down.||With dedicated and shared clusters, you are required to select a cluster tier based on your resource needs at deployment. Cluster resources can be monitored and manually scaled up or down or you can enable auto-scaling for dedicated clusters with pre-set maximum and minimum thresholds. Note: auto-scaling is not instantaneous.|
|Costs||Serverless instances are billed on usage: reads, writes, storage, backup and data transfer. You only pay for the resources you use.||Clusters are billed monthly based on the predetermined storage, CPU and RAM of your chosen cluster tier. You pay a set price regardless of actual usage.|
Serverless instances are billed based on consumption and usage of reads (RPUs), writes (WPUs), storage, backup and data transfer. View pricing →.
During preview, serverless instances are best suited for low-risk applications with variable or infrequent traffic, or for development and testing workloads in a cloud environment.
If you are looking for a database that you can get started with quickly with minimal configuration that automatically scales to meet your workload, we encourage you to trial the preview of serverless instances and share your feedback with us.
Since serverless instances run on the latest version of MongoDB, they require up-to-date drivers. Your current driver may require an update in order to connect to your serverless instance. For a list of supported drivers for serverless instances, see Minimum Driver Versions for Serverless Instances.
To add data to your serverless instance you can:
use the Export and Import Data feature available in MongoDB Compass.
mongorestoreMongoDB database tools (version 100.5.0 and up).
In preview, serverless instances do not currently support MongoDB Realm. For the most up-to-date information on what is supported with Atlas serverless instances, see Serverless Instance Limitations and Considerations.
If you have any suggestions on how to improve serverless instances we’d love to hear from you. Please share your feedback with us via the MongoDB Feedback Engine or start a
serverless discussion in the community forums.