MongoDB

active

by MongoDB, Inc. · since 2009 · also known as Mongo, MongoDB Community Server, MongoDB Enterprise Advanced

The default document database: flexible BSON documents, rich queries and built-in sharding.

documentsearch enginevectortime-seriesspatialdatabase enginesource-availablemature

Overview

MongoDB stores data as BSON documents in collections and queries them with the MongoDB Query API and aggregation pipeline, so application objects map onto storage without an ORM. Replica sets give automatic failover, native sharding spreads data across many nodes, and multi-document ACID transactions have been available since 4.0. Version 9.0 (GA September 2026) continues the push into search, vector search and performance. It is the reference implementation that a whole ecosystem of 'MongoDB-compatible' services measures itself against, but the server is under the source-available SSPL rather than an OSI license.

Strengths & trade-offs

Strengths

  • +Document model maps directly to application objects; nested arrays and subdocuments avoid many joins
  • +Native sharding plus replica sets with automatic failover, built into the core server
  • +Aggregation pipeline is expressive enough for most reporting without a separate ETL step
  • +Change streams give a resumable, ordered feed of writes for event-driven systems
  • +Largest driver, tooling and hiring ecosystem of any document database
  • +Queryable Encryption and field-level encryption for sensitive fields

Trade-offs

  • −SSPL is not OSI open source, which blocks some redistributors and cloud vendors
  • −Poor shard-key choices are painful to fix and can create hot shards
  • −Multi-document transactions work but carry real latency and contention costs at scale
  • −Embedding-versus-referencing decisions push data-modelling work onto the application team
  • −Several advanced features (in-memory engine, auditing, encryption at rest) are Enterprise-only

Great for

  • +Product catalogs with highly variable attributes
  • +Content management and user-generated content
  • +Mobile and web backends that evolve their schema weekly
  • +IoT and event data with time-series collections
  • +Operational data stores aggregating many upstream systems
  • +RAG and semantic search next to operational data

Think twice for

  • −Heavily relational models with many-to-many joins
  • −Large analytical scans (use a columnar warehouse)
  • −Teams that need a permissive OSI license for redistribution

Capabilities

Native or official first-party support · 16 of 25 tracked

✓Transactions
✓Joins
✓Secondary indexes
✓Full-text search
✓Vector search
✓Geospatial
✓JSON
✓Change data capture
✓Materialized views
✓TTL / expiry
✓In-memory
✓Durable persistence
✓Compression
✓Encryption at rest
✓Role-based access
✓Online schema changes
–Triggers
–Stored procedures
–Pub/Sub
–Columnar storage
–Time travel
–Branching
–Streaming ingest
–Offline sync
–Runs in WebAssembly

Scale & consistency

Comfortable data size
Large · ≤ 1 PB
Horizontal scaling
Native
Multi-region
Read replicas
Transactions
Full ACID
Consistency
Tunable, Causal
Schema
Flexible
Architecture
Primary replica, Distributed, Client server
Query languages
MongoDB Query API (MQL), Aggregation pipeline

Range/hashed sharding scales writes; each shard has one primary. Zone sharding can pin data (and its writes) to a region, but a given document is written in one place.

Deployment

Self-hosted Vendor-managed cloud Serverless Embedded Edge Kubernetes operator

available on · AWS · Google Cloud · Azure

Ecosystem

compatible withMongoDB
apis & protocolsMongoDB wire protocol
client languagesC, C++, C#, Go, Java, Kotlin, JavaScript, PHP, Python, Ruby, Rust, Scala, Swift
used byCoinbase, Forbes, Bosch

Alternatives to MongoDB

Compare all→
MongoDB AtlasDocument15.6

MongoDB's own multi-cloud DBaaS, bundling search, vector search and stream processing.

mongodb vs mongodb-atlas →
Couchbase ServerDocument27.5

Memory-first distributed JSON database with SQL++, search, vector indexes and mobile sync.

mongodb vs couchbase →
Amazon DocumentDBDocument15.7

AWS's managed MongoDB-API database on a proprietary, Aurora-style storage layer.

mongodb vs amazon-documentdb →
Azure Cosmos DBDocument45.3

Microsoft's globally distributed, multi-API NoSQL and vector database with SLA-backed latency.

mongodb vs azure-cosmos-db →
DocumentDB (open-source, PostgreSQL-based)Document5.4

MIT-licensed, MongoDB-compatible document engine built as PostgreSQL extensions, run by the Linux Foundation.

mongodb vs documentdb-postgres →
Percona Server for MongoDBDocument5.9

Drop-in MongoDB Community build with enterprise features like encryption, LDAP and hot backup.

mongodb vs percona-server-mongodb →

MongoDB FAQ

What is MongoDB?

MongoDB is a document database by MongoDB, Inc., first released in 2009. MongoDB stores data as BSON documents in collections and queries them with the MongoDB Query API and aggregation pipeline, so application objects map onto storage without an ORM. Replica sets give automatic failover, native sharding spreads data across many nodes, and multi-document ACID transactions have been available since 4.0. Version 9.0 (GA September 2026) continues the push into search, vector search and performance. It is the reference implementation that a whole ecosystem of 'MongoDB-compatible' services measures itself against, but the server is under the source-available SSPL rather than an OSI license.

Is MongoDB open source?

Not in the OSI sense. MongoDB is source-available: you can read the code, but the license restricts some uses, typically offering it as a competing managed service. License: Server Side Public License v1 (Community); commercial (Enterprise).

Does MongoDB support ACID transactions?

Yes. MongoDB supports full ACID transactions, with tunable, causal consistency.

Does MongoDB scale horizontally?

MongoDB scales horizontally out of the box, with built-in sharding or partitioning. It is comfortable at large scale (≤ 1 PB). It supports cross-region read replicas.

How can I run MongoDB?

You can self-host it and use the vendor's managed cloud. Managed offerings include MongoDB Atlas. It is available on AWS, Google Cloud and Azure.

What is MongoDB best for?

MongoDB is a strong fit for product catalogs with highly variable attributes; content management and user-generated content; and mobile and web backends that evolve their schema weekly. Think twice for heavily relational models with many-to-many joins.

What are the best alternatives to MongoDB?

Common alternatives to MongoDB include MongoDB Atlas; Couchbase Server; Amazon DocumentDB; Azure Cosmos DB; and DocumentDB (open-source, PostgreSQL-based). The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.

How popular is MongoDB?

MongoDB ranks #4 of 844 databases on the WhichDB Score (80.5/100), and #1 among document databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.