MongoDB is not tied to one cloud platform or any other specific usage model. It can be installed on-premise, in a cloud, or used as a database-as-a-service in all three major public clouds (Microsoft Azure, AWS, Google Cloud Platform).
But many people want to run MongoDB on Azure. Because MongoDB runs everywhere it can also run in different ways on Azure. This article helps you weigh the options.
The following sections explain the basics of how to get started, answer common questions, and present the pros and cons of each choice.
The fastest way to get started building with MongoDB on Azure is to use MongoDB Atlas, MongoDB’s database-as-a-service offering.
MongoDB Atlas is fully managed MongoDB in the cloud (in this case, Microsoft Azure). Because Atlas is a fully managed cloud service, developers and operations teams don't have to spend their time doing manual database administration work, empowering them to focus on development.
These benefits are part and parcel of database-as-a-service, but MongoDB Atlas also offers advanced features and integrations.
MongoDB Atlas is a productized version of MongoDB Enterprise Server running on a cloud platform. It offers a larger set of services and capabilities that are all integrated, operated, and maintained by MongoDB engineers and operational staff. For example, Lucene search is integrated out of the box.
Key things to understand about MongoDB Atlas:
No lock-in. MongoDB Atlas runs the same software on all public clouds.
Extreme-scale. Start with an M0 free tier cluster and scale up with no changes to your application. (Learn more here about the various tiers up through M700, and their pricing.)
Reliability. MongoDB is designed with high availability and replication in mind, so even the free tier cluster is deployed as a three-member replica set. You decide where that replica set will be hosted.
MongoDB Atlas enables developers to get started right away. Increasingly, database-as-a-service is also the preferred model for IT and Ops because it offloads the difficult and time-consuming work of database administration and ensures that the database is secure, reliable, and patched.
While the MongoDB database that powers MongoDB Atlas is the same database that is at the foundation of MongoDB Community and MongoDB Enterprise, new advanced capabilities have been added, including:
MongoDB Atlas Search: The Lucene search engine has been integrated into Atlas to provide rich search capabilities.
Multiple geographies: MongoDB Atlas supports Cross Region Replication, which allows a database to have active replicas in data centers around the world, increasing reliability in the event of a service disruption of any kind.
Global Clusters enable MongoDB Atlas to support low latency, location-aware reads and writes.
Data Explorer allows you to query, explore, and take action on your data residing inside MongoDB Atlas (with full CRUD functionality) right from your web browser.
Because MongoDB Atlas is a cloud database, it can be used as a platform for new types of development and data management techniques:
MongoDB Realm's application development services enable developers to quickly build applications without having to set up server infrastructure.
As you move to larger clusters (M10 and above), you need features that make it easy to scale. MongoDB Atlas offers the following:
Cluster Autoscaling, which automatically scales a cluster’s tier, storage capacity, or both in response to cluster usage. To control costs, you can specify a range of cluster tiers to which your cluster can automatically scale.
Single pane of glass management through the Real Time Performance Panel (RTPP). Shows network traffic, database operations, and hardware statistics on the machines hosting your clusters. Review metrics like query execution times and the ratio of documents scanned to documents returned.
If you want to quickly get started as an individual or a team, MongoDB Atlas starter clusters are the way to go. You can always upgrade later when you need the advanced features mentioned above.
The M0 clusters (Free Tier): Starter clusters for teams learning MongoDB or developing small applications. This type of cluster is free for anyone to use.
The M2 clusters: Offers the same capabilities as M0 with 2GB of storage
The M5 clusters: Offers the same capabilities as M0 with 5GB of storage
Many teams find that for a variety of reasons they want to move from a shared cluster like M0 and M2/M5 to a dedicated cluster. Dedicated clusters have increasing amounts of storage, memory, and CPU power:
Thecluster tier page summarizes all cluster types for MongoDB Atlas.
To get started right away with MongoDB Atlas, go to the Atlas registration pageor read on to learn about self-managing MongoDB on Azure.
So far we’ve covered running MongoDB Atlas on Azure. The other choice is installing MongoDB on a server on Microsoft Azure. Like installing any software at the operating system level, this takes more know-how.
Installing and managing MongoDB yourself may make sense for a couple of reasons:
It’s how you roll. Some teams are more comfortable managing their own tools and have the skillset to do so.
Your MongoDB application is deeply customized and integrated with other software that you self-manage. If so, migration to Atlas is an option, but you might want to start by self-installing MongoDB on Azure.
Once Azure, both the Azure environment and MongoDB must be monitored and adjusted as needed. The team responsible for MongoDB must:
Configure Azure infrastructure and MongoDB to suit their application.
Monitor the MongoDB cluster’s operations and adjust as needed to resolve any issues.
Apply updates and patches to MongoDB.
Handle backup and recovery.
Configure the security of the underlying Azure infrastructure.
MongoDB Cloud Manager (free trial available) offers an alternative for much of this work. It handles backup and recovery, query optimization, alerting and the Real-Time Performance Panel (RTPP) that comes standard with Atlas. The 30-day free trial offers Cloud Manager Standard; a premium version that offers a performance advisor and index suggestions (as well as fine-grained monitoring) is also available. After the free trial, you also have the option of a free version that does not include RTPP.
So far we’ve covered the differences between running MongoDB Atlas or installing (and managing) MongoDB yourself. Note that we did not cover Microsoft Cosmos DB, which is not MongoDB but rather an emulation API offered as a service.
Of the two main choices, what is best for you? That depends on your expertise and your intentions. Here are some considerations:
If you are just getting started with MongoDB, the MongoDB Atlas M0 starter cluster is the fastest way to get started.
If you don’t want to be bothered with the many tasks associated with installing and administering a database, look at MongoDB Atlas.
If you want integrated search and other advanced features, these come standard with Atlas.
If you want greater control of your operations for whatever reason, self-managed MongoDB makes sense.
If your MongoDB application is highly customized and deeply integrated with other tools, and running on a previous version, you may want to self-manage at least until you evaluate the pros and cons of a live migration.
If you choose to self-manage, you can still benefit from Cloud Manager, which gives you not only monitoring, backup, and recovery but also the single pane of glass management features of the Real-Time Performance Panel.
In the long run, it comes down to management complexity. A self-managed instance offers benefits from an infrastructure provisioning and management standpoint, but a lot of the complexity that you managed on-premise is replicated to the cloud. That works for teams built to handle that operational complexity. If you want to move away from the complexity of self-management, consider migrating to MongoDB Atlas.
All of this said, the really important thing is knowing what you want to do now and in the future. If development is your focus, MongoDB Atlas is the way to go; if you have an experienced ops team that wants self-management, that option is always available. Both of these choices offer the same type of amazing scalability and responsiveness that developers and application architects (not to mention users) love.