ApsaraDB for MongoDB, Where We Are and Where We Are Going

By Cen Zheng, Alibaba Cloud Intelligence


ApsaraDB for MongoDB is Alibaba Cloud’s fully managed MongoDB service. It was initially released at 2016. In late 2019, Alibaba Cloud had a partnership with MongoDB, Inc. (NASDAQ: MDB), becoming an authorized MongoDB-as-a-Service solution provider. In 2020, Alibaba Cloud was awarded MongoDB’s “Independent Software Vendor (ISV) Partner of the Year”. This article will talk about ApsaraDB for MongoDB’s history and the service provided. Meanwhile, several new features available recently on ApsaraDB for MongoDB including MongoDB 4.4 on Alibaba Cloud, Cloud Disk Storage Type support, Serverless instance type and DynamoDB Compatibility will be introduced.

History of ApsaraDB for MongoDB

ApsaraDB for MongoDB was initially released at 2016, providing Replica Set instance type only with MongoDB 3.2. In the following years, many features including sharded cluster support,PITR, Auditing, Transport Encryption and so on were released, with the major version supported upgrading to MongoDB 4.0. In late 2019, Alibaba Cloud had a partnership with MongoDB company, becoming an authorized MongoDB-as-a-Service provider at China. In the same year, the latest MongoDB version, MongoDB 4.2 and Encryption at Rest were available on Alibaba Cloud. In the recent year, ApsaraDB for MongoDB was on the way to support MongoDB 4.4 on Alibaba Cloud and several new features, including cloud disk storage type, Serverless and DynamoDB Compatibility.

A glance at ApsaraDB for MongoDB

Here is a glance at ApsaraDB for MongoDB.

Instance type

Currently there are three instance types for MongoDB available on Alibaba Cloud, including the typical Replica Set/Sharded Cluster and Alibaba Cloud exclusive Serverless.

For replica set, a 3 nodes cluster with Primary/Secondary/Hidden was deployed typically. This ensures high availability for MongoDB service by default. Cross availability-zone deployment was available for those regions who has 3 availability-zones. If higher availability was required, more electable nodes, like 5 or 7, can be employed. Also, additional read-only nodes can be added to scale read requests, up to 5. On the contrary, there exists a standalone instance type for those business who does not have high availability requirements.

A sharded cluster is made of multiple shards, each one is also a 3 nodes replica set. A sharded cluster is able to scale horizontally by adding shards. Each shard has its own cluster tier, and is able to scale vertically alone.

Serverless is a new instance type provided by Alibaba Cloud aiming at making the usage threshold of MongoDB service even lower. More details will be covered later.

MongoDB versions

MongoDB major versions provided on Alibaba Cloud are 3.4/4.0/4.2 and 4.4. Each version is able to upgrade to any higher version by a simple click on the console. Minor version upgrade is done automatically during the instance’s daily maintenance window, without impacting user’s business.


Aside from instance deployment and major/minor version upgrade, Alibaba Cloud also automates all instance lifecycle managements including scaling, metrics monitoring/alerting and backup/restore.

ApsaraDB for MongoDB provides end-to-end security solution from VPC network isolation, IP whitelist access control, Auditing, Transport Encryption and Encryption at Rest.

Alibaba Cloud also provides variety database ecosystem service and tools. Data Transmission Service helps you migrate and sync data between instances. A corresponding open src tool called MongoShake is also available on the GitHub. Data Management is a visualized data management platform. Database Backup is a secure and cost-efficient solution for continuous data protection. Database Autonomy Service (DAS) is a cloud service that implements self-perception, self-repair, self-optimization, self-O&M, and self-security of databases based on machine learning and expert experience. Currently, DAS’s most significant features around MongoDB is index recommendation driven by an external cost-based diagnosis engine. Last but not the least, in Alibaba Cloud, there are several experienced MongoDB experts not only in maintenance but also very familiar with MongoDB internals.

New features general available on ApsaraDB for MongoDB

There are four new features general available on ApsaraDB for MongoDB. First is to have MongoDB 4.4 available on Alibaba Cloud. Second is the new Cloud Disk Storage Type support. In the past, Local SSD is used as MongoDB’s storage type, and now Alibaba Cloud Enhanced SSD (also short for ESSD) storage type is available. Third, as mentioned before, a new Serverless instance type is added. Finally, is the DynamoDB compatibility feature, which enables MongoDB sharded cluster another popular document style API, providing 50% lower TCO for existing DynamoDB business.

MongoDB 4.4

MongoDB 4.4 is the latest major version released this year. It is a user-driven engineering release including a number of features and improvements that have been most requested by the MongoDB community. Now it is available on Alibaba Cloud.

Cloud Disk Storage Type

Alibaba Cloud Enhanced SSD enables ApsaraDB for MongoDB a cloud-native way for scaling up/out without data migration. With local SSDs, performing a scaling up may need to add a new node remotely, performing a full initial sync. This may take a long time (maybe hours or even days) if the instance contains much data. Cloud Disk’s usage decouples the storage and compute node. A simple detach and re-attach process would be enough. This will significantly improve the scaling user experience. Also, enhanced resource isolation for I/O will be provided. One Cloud Disk’s resource is accessed exclusively by only one tenant. This will avoid many “noisy neighbors” stories happening again. Furthermore, it is able to taking advantage of the much faster snapshot backup/restore than physical ways and higher performance of ESSD than local SSD.


The key features of Serverless are on-demand charging and auto-scaling. It is very suitable for business which has unpredictable database workloads. Another situation is when user has hundreds or thousands of databases to manager with but only few of them are active in the same time. MongoDB Serverless introduces a new way to describe cluster tier, Capacity Unit. It is a performance currency abstracting the system resources such as CPU, IOPS and memory consumed by database operations. Charging on-demand by the Capacity Unit consumed by the database can be cost-saving compared to provisioning capacity.

DynamoDB Compatibility

With this feature, User can use ApsaraDB for MongoDB sharded cluster as a drop-in replacement for DynamoDB. A DynamoDB API compatible layer is implemented in front of a MongoDB sharded cluster, to translate the DynamoDB protocol to MongoDB protocol. Applications using DynamoDB SDKs only need to modify an endpoint configure, all things will still work. An open src tool called NimoShake is also provided to help migrating data from DynamoDB to DynamoDB-API-compatible MongoDB.

Almost all data types and APIs including control plane and data plane are compatible. For example, Local/Global Secondary Indexes, Conditional Writes, ReturnValues, Projections, ParallelScan and so on, are all implemented. More compatibility features like Streams are upcoming.

Ok, so why migrating from DynamoDB? Some tests have been performed comparing the performance and price between ApsaraDB for MongoDB and DynamoDB. To sum up, a typical chosen MongoDB sharded cluster tier is 50% cheaper than DynamoDB, but providing 3 times higher performance. This could be a huge TCO reduction.


ApsaraDB for MongoDB is a fully managed and authorized MongoDB service. Four new features are available recently. The “User-driven engineering” release, MongoDB 4.4 is now available on Alibaba Cloud. The new Cloud Disk Storage Type brings ApsaraDB for MongoDB a cloud-native scaling experience and more predictable and higher performance. A new instance type, which can be cost and effort-saving, Serverless is provided. Finally, A drop-in replacement and high performance-price ratio DynamoDB Compatibility solution is available on ApsaraDB for MongoDB. ApsaraDB for MongoDB will continue to improve, aiming at providing the best MongoDB-as-a-Service.

Alibaba Tech

First hand and in-depth information about Alibaba’s latest technology → Facebook: “Alibaba Tech”. Twitter: “AlibabaTech”.

First-hand & in-depth information about Alibaba's tech innovation in Artificial Intelligence, Big Data & Computer Engineering. Follow us on Facebook!