The MongoDB database provides organizations an opportunity to evolve and store data without being confined to the initial underlying data model. As part of an Azure database deployment, MongoDB can add its capabilities to the Microsoft cloud’s scalability and services. These capabilities can make MongoDB usage a key part of your Azure big data workloads.
This post will introduce you to the two major deployment options for using MongoDB on Azure, deploying with a managed service or running it on self-managed compute instances, and cover all of the following:
A NoSQL database is everything an SQL database is not. It is a non-tabular storage that allows you to store data in document, key-value, wide-column, or graph. This non-tabular nature of NoSQL makes it easy to scale horizontally across distributed nodes unlike SQL databases which scale primarily vertically.
Founded in 2007 and a NoSQL database, MongoDB is an open-source database built to address the scalability needs of 21st century applications.
Unlike relational databases where data is stored in tables following a predefined schema, MongoDB typically stores data as a JSON object allowing for the flexibility to evolve data schema without being restricted to a predefined data schema.
Some common use cases for MongoDB include:
There is support for MongoDB on a wide range of cloud providers, Azure included. You can use MongoDB on Azure regardless of your system's architecture. Whether you're already operating on Azure, looking to switch, or using a different cloud service for your application, when you combine MongoDB with Azure, you get the added benefits Azure cloud computing has to offer.
There are two ways to use MongoDB on Azure:
For the rest of this post, we’ll explore the pros and cons of the two deployment options and how to migrate your existing MongoDB cluster to Azure.
The managed deployment option lifts the burden of installation and configuration from enterprises, allowing them to focus on their business domain. There are two alternatives when it comes to managed deployment options. You can either use Azure managed option Cosmos DB or a third-party managed option through MongoDB Atlas.
Microsoft Azure Cosmos DB is a fully managed, distributed, scalable schema-agnostic, multi-model NoSQL database. It provides flexible access to data using the API of choices such as SQL API (JSON), MongoDB API (BSON, key-value), and Gremlin API (graph), Table API (key-value) and Cassandra API (columnar), which are all essentially supported. You can integrate Azure Cosmos DB using your existing MongoDB clients.
Cosmos DB is not the same as MongoDB. There is a connection though: Azure Cosmos DB was implemented based on a wire protocol that allows clients to work on Cosmos DB as comfortably as if it was an actual MongoDB database. That gives existing MongoDB users a familiar interface. However, there are key differences and before shopping for a deployment option, you should familiarize yourself with the differences and limitations.
While Azure Cosmos DB has some limitations, it also has some strengths that made it suitable for a wide range of use cases. In this section we’ll take a look at them both.
There is another consideration to keep in mind between Cosmos DB and MongoDB: Azure pricing for Cosmos DB is billed per hour. You’re charged based on your provisioned throughput. You can use Azure price calculator to estimate your cost.
If you like to use a managed MongoDB database on Azure but not a MongoDB-compatible option like Cosmos DB, there is another option: MongoDB Atlas, the fully managed database-as-a-service platform provided by MongoDB that allows you to use MongoDB across the major cloud providers including Azure.
Businesses choose self-managed options when they want full control over the database and the compute resources their cluster runs. Azure VMs allow them to do so.
The easiest way to deploy MongoDB on Azure VM is through Azure Resource Manager (ARM) template. ARM templates are JSON files that contain the information on how your infrastructure is defined and how it should be configured. To deploy MongoDB on Azure, you can either define an ARM template or use existing MongoDB ARM templates.
Various applications have different specifications. An application's requirement could require you to use a self-managed alternative. As a result, it's important to weigh the benefits and drawbacks. Let’s take a look at them each.
There are several ways to migrate MongoDB to Azure:
With Cloud Volumes ONTAP, there is a way to combine the advantages of both deployment options and get the best of both worlds.
Cloud Volumes ONTAP is a data management platform for Azure, AWS, and Google Cloud that enables enterprises to easily deploy MongoDB databases and scale their applications quickly without compromising performance. As a data management layer built on native Azure compute and storage, with Cloud Volumes ONTAP you combine the configurability and control of the managed storage option with feature benefits of a managed service.
With Cloud Volumes ONTAP, your MongoDB deployment on Azure:
With its centralized management via NetApp Cloud Manager, you gain visibility over all of your storage volumes no matter which cloud they’re running in and the ability to carry out IAC operations through RESTful API calls.
This goes beyond the limitations of a managed service, while providing features that building and managing your own MongoDB deployment on virtual machines can’t match: