NoSQL Showdown: MongoDB Atlas vs. AWS DocumentDB!
Last month, Amazon’s AWS released DocumentDB, a product with “MongoDB compatibility”. In this post, we will cover the differences between MongoDB’s Atlas product and Amazon’s DocumentDB.
One big difference between Mongo’s Atlas and DocumentDB is Atlas’ free tier. Atlas allows developers to get up and running with a small instance of a hosted DB without first putting a credit card number in. Additionally, the cheapest DocumentDB instance starts at a relatively steep $200/month before adding I/O costs.
One interesting aspect to Mongo’s Atlas is that it can be hosted on any of Amazon’s AWS, Microsoft’s Azure, or Google’s Cloud Platform. This provides some flexibility to companies looking to shop around to different cloud providers. In a world where we’re seeing more companies take a multi-cloud approach, being locked into one provider may be a disadvantage.
While AWS advertises DocumentDB as having “MongoDB compatibility”, from what we can tell, AWS is mimicking some of the MongoDB APIs (specifically from MongoDB version 3.6) while using the Aurora PostgreSQL engine under the hood.
Many features released in MongoDB version 4.0 are not available in DocumentDB. Here is the list of DocumentDB’s supported MongoDB APIs. Some important missing features include: “oplog” (Replcia Set Oplog) which is a special capped collection that keeps a rolling record of all operations that modify the data stored in your databases and “Change Streams”, which allow applications to access real-time data changes without the complexity and risk of tailing the oplog.
Missing these features makes DocumentDB infeasible as a drop-in replacement for MongoDB if your current workload uses any of the APIs that DocumentDB doesn’t support.
Both systems allow for data replication (of course)! MongoDB Atlas provides up to 50 replicas and AWS DocumentDB provides up to 15 replicas.
But MongoDB Atlas allows replicas to span across multiple cloud availability zones (i.e. regions), whereas DocumentDB replication is limited to within one region. Cross-region replication provides fault tolerance while still allowing for local reads.
MongoDB’s Atlas additionally provides low-latency global writes from anywhere in the world, whereas DocumentDB will be limited to its one region.
As long as your MongoDB Atlas deployment is running on a big enough cluster (M30 cluster tier and up — see tier sizes here), you can shard your data (see docs). DocumentDB does not have sharding functionality.
AWS DocumentDB is billed as a drop-in replacement for existing on-prem or cloud-deployed MongoDB instances, but, upon further inspection, DocumentDB is only a partial replacement to MongoDB’s Atlas cloud product. When considering which to use, be sure that your current (or future) data workflows do not utilize MongoDB features that DocumentDB does not support. Also be sure to understand the tradeoffs and differences between the products.
P.S. A quick/fun reminder about AWS product naming: AWS’s famous DynamoDB is in fact not an implementation of leaderless replication system known as “Dynamo-style”.