MongoDB FAQ

What is MongoDB?

MongoDB is a general purpose, document-based, distributed data platform built for modern application developers and for the cloud. No data platform is more productive to use.

Why is MongoDB useful?

The MongoDB data platform is built around three core design principles that collectively enable you to build faster, and with higher quality:

  1. The document data model – presenting you the best way to work with data.

  2. A distributed systems design – allowing you to intelligently put data where you want it.

  3. A unified experience that gives you the freedom to run anywhere – allowing you to future-proof your apps and eliminate vendor lock-in.

Learn more by reading the MongoDB Architecture Guide.

When should I use MongoDB?

The MongoDB data platform can be used across a range of OLTP and analytical apps.

With the MongoDB Server and MongoDB Atlas Data Lake (currently in beta), you can address a wide range of application requirements.

MongoDB Server & Atlas: OLTP & Online Analytics

The MongoDB Server is a general purpose database designed to serve most OLTP and online analytics workload:

  • Wherever you are thinking about using a relational database, you should consider MongoDB.

  • Wherever you are thinking about using a NoSQL database, you should consider MongoDB.

Whether you plan to run your apps in your own facilities, as a serverless, cloud-native solution, or a hybrid deployment model in between, the MongoDB Server provides complete infrastructure agility. You can run MongoDB yourself on your own infrastructure, or use MongoDB Atlas, our fully managed and fully automated global cloud database service available on over 60 regions across AWS, Azure, and GCP

MongoDB Atlas Data Lake (Beta): Offline Analytics

Beyond the MongoDB Server, the MongoDB Atlas Data Lake extends the power and productivity of MongoDB to offline analytics workloads. The Atlas Data Lake allows you to quickly and easily query data in any format on Amazon S3 (with other cloud providers coming soon) using the MongoDB Query Language and tools.

With Atlas Data Lake you can realize the value of your data lake faster: you don’t have to move data anywhere, you can work with complex data immediately in its native form, and with its fully-managed, serverless architecture, you control costs and remove the operational burden.

The MongoDB Data Platform

Through the MongoDB Server and Atlas Data Lake, you have an integrated data platform that shares the same query language and tools, fully managed for you by the cloud-native Atlas service, enabling you to serve a broad range of operational and analytical applications:

  1. MongoDB Atlas: designed for online OLTP applications requiring millisecond response times, provisioned with dedicated analytics nodes for real time analytics against live, operational data.

  2. MongoDB Atlas: Online analytics with optimized secondary indexes to support predictable query patterns requiring latency in the range of subsecond to several second response times.

  3. MongoDB Atlas Data Lake: Designed for offline analytics against large volumes of data residing in cloud storage, with latency in the range of seconds (at the very least), but more typically minutes and more – dictated by how much data you are querying and how it is partitioned.

To learn about use cases for MongoDB, and those workloads where you should evaluate alternative technologies, review the MongoDB Use Case Guidance white paper.

How is MongoDB different from relational databases like Oracle?

Relational databases like Oracle, MySQL, SQL Server, Postgres and others are built on architectures originally designed over 40 years ago. The requirements for applications were very different back in the 1970s than they are with today's modern applications. When Oracle first released their commercial database in 1979 it cost about $3,000 USD per MB of storage. Costs like these forced software architects to normalize data and create multiple join tables to store application data in an attempt to eliminate any redundancy. As a result, relational database applications today contain tens, hundreds and in some cases thousands of tables that need to be joined together to obtain query results. Not only does this complexity require the developer to write complicated SQL queries but having many tables in a query require higher I/O demands increasing infrastructure costs.

MongoDB was designed with the developer in mind getting the database out of the way and increasing productivity. With MongoDB simply store the data as it's used within the application and query the data with a modern query language. You schema is flexible, enabling developers to continuously integrate new functionality.

Unlike Oracle and other relational databases, MongoDB is built on a distributed systems architecture, enabling you scale out your database across multiple instances – which can be one region, or spread globally across multiple regions.

Check out the Oracle and MongoDB Compared page to dig deeper into the differences.

How can I learn about MongoDB?

The easiest way to learn MongoDB is through our free online training courses for developers and DBAs at MongoDB University. MongoDB University online training courses are developed and taught by MongoDB, Inc. engineers. MongoDB University has had over 1 million registrations from 196 countries: these students have learned how to develop and deploy applications on MongoDB.

MongoDB University free courses cover everything you need to know to become a MongoDB expert. Online training courses are developed specifically to help you build new skills in the areas that matter most to employers. The online training courses are based on real-world applications and taught by our dedicated team of in-house engineers who work on the code every day and have seen use cases across 13,000+ companies.

MongoDB University training courses are self-paced, allowing you to review the videos and course materials at a time that is convenient for you. At the same time, we offer structure to your learning with weekly assignments and deadlines to check in on your progress and a final exam to test your knowledge. Most courses run for three weeks, and each week typically requires just 90 minutes of your time. Find a course that’s right for you. View the course catalog.

How can I become a MongoDB Certified Professional?

Take the MongoDB Certification Exam to prove your expertise and become a MongoDB Certified Professional Developer or DBA. MongoDB certifications recognize developers and DBAs with the knowledge needed to build and maintain MongoDB applications.

To prepare for the certification exam, take our Practice Exam to build confidence by familiarizing yourself with the subject areas and format of the certification exam. In addition to the practice exam is our Study Guide. The Study Guide covers all of the topics on both the Developer and DBA exams. Each section of the guide links to relevant documentation and other online resources.

The MongoDB Server is free to use. What does MongoDB, Inc. sell?

We are the company that builds and runs MongoDB. Over 14,200 organizations rely on our commercial products. We offer software and services to make your life easier:

The MongoDB Database

  • MongoDB Atlas is the global cloud database service for modern applications. Deploy fully managed MongoDB across AWS, Azure, or Google Cloud with best-in-class automation and proven practices that guarantee availability, scalability, and compliance with security standards. Use MongoDB’s robust ecosystem of drivers, integrations, and tools to build faster and spend less time on operations and database administration.

  • MongoDB Enterprise Advanced is the best way to run MongoDB on your own infrastructure. It's a finely-tuned package of advanced software, support, certifications, and other services designed for the way you do business.

  • MongoDB Cloud Manager is a cloud-based tool that helps you manage MongoDB on your own infrastructure. With automated provisioning, fine-grained monitoring, and continuous backups, you get a full management suite that reduces operational overhead, while maintaining full control over your databases.

MongoDB Analytics and Visualization

  • MongoDB Atlas Data Lake allows you to quickly and easily query data in any format on Amazon S3 using the MongoDB Query Language and tools. You don’t have to move data anywhere, you can work with complex data immediately in its native form, and with its fully-managed, serverless architecture, you control costs and remove the operational burden.

  • MongoDB Charts is the best way to create visualizations of MongoDB data anywhere. Build visualizations quickly and easily to analyze complex, nested data. Embed individual charts into any web application or assemble them into live dashboards for sharing.

  • The MongoDB Connector for BI lets you use MongoDB as a data source for your existing SQL-based BI and analytics platforms such as Tableau, Microstrategy, Looker, and more.

  • The MongoDB Connector for Apache Spark exposes all of Spark’s libraries, including Scala, Java, Python and R. MongoDB data is materialized as DataFrames and Datasets for analysis with machine learning, graph, streaming, and SQL APIs.

Mobile Database and Serverless Application Platform

  • The MongoDB Realm Database has been installed over 2 billion times, offering a fast, easy-to-use, alternative to SQLite and Core Data. With support for complex queries, safe threading, a reactive architecture to create responsive and fluent UIs, encryption, and cross-platform support, developers can simplify their code and build powerful and engaging experiences on more devices.

  • The MongoDB Realm and Stitch Platform helps you build better fullstack apps faster. It offers easily configurable rules for accessing data and services directly from your application frontend, along with serverless functions to execute application logic. You can automatically sync data between the client and backend data layer. Through integrations with your code repositories you can develop locally and then seamlessly deploy version-controlled application updates to test and production.

MongoDB Services

  • MongoDB Consulting packages get you to production faster, help you tune performance in production, help you scale, and free you up to focus on your next release.

  • MongoDB Training helps you become a MongoDB expert, from design to operating mission-critical systems at scale. Whether you're a developer, DBA, or architect, we can make you better at MongoDB.

Contact us to learn more

Can I get a commercial license for MongoDB?

Yes, you can get a commercial license for MongoDB with the purchase of MongoDB Enterprise Advanced.

How is data stored in the MongoDB database?

Data in MongoDB is stored in BSON documents – JSON-style data structures. Documents contain one or more fields, and each field contains a value of a specific data type, including arrays, binary data and sub-documents. Documents that tend to share a similar structure are organized as collections.

It may be helpful to think of documents as analogous to rows in a relational database, fields as similar to columns, and collections as similar to tables.

Learn more in the MongoDB Architecture Guide.

As a developer, how do I work with MongoDB documents?

To accelerate developer productivity, MongoDB provides native drivers for all popular programming languages and frameworks. Supported drivers include Java, Javascript, C#/.NET, Go, Python, Perl, PHP, Scala and others. All supported MongoDB drivers are designed to be idiomatic for the given programming language. This makes it much more natural for developers to work with data than string-based languages like SQL, and eliminates the need for cumbersome and fragile ORM abstraction layers.

You can also interact with MongoDB graphically using MongoDB Compass, the GUI for MongoDB. Through Compass you can explore and manipulate your data, visually create queries and aggregation pipelines from the GUI and then export them as code to your app; examine query execution and performance; view and create indexes; build schema validation rules and views; and more.

Does MongoDB support ACID transactions?

Yes. Multi-document ACID transactions have been available since the MongoDB 4.0 release in 2018.

Where can I run MongoDB?

MongoDB can be run anywhere, providing you complete freedom from platform lock-in.

MongoDB Atlas provides you with a complete, pay-as-you-go, fully managed service for MongoDB on AWS, Azure, and Google Cloud.

You can download MongoDB and run it yourself anywhere. MongoDB Ops Manager is the best way to run MongoDB on your own infrastructure, making it fast and easy for operations teams to deploy, monitor, backup and scale MongoDB. The capabilities of Ops Manager are also available in the MongoDB Cloud Manager service.

Does MongoDB scale?

Tens of thousands of organizations use MongoDB to build high-performance systems at scale. Organizations ranging from Fortune 100 enterprises to the most agile startups rely on MongoDB. They've grown from single server deployments to clusters with over 1,000 nodes, delivering millions of operations per second on more than 100 billion documents and petabytes of data. Learn more.

Through sharding, you can automatically scale your MongoDB database out across multiple nodes to handle write-intensive workloads and growing data sizes. Sharding with MongoDB allows you to seamlessly scale the database as your apps grow beyond the hardware limits of a single server, and it does so without adding complexity to the application. To respond to changing workload demand, documents can be moved between shards, and nodes can be added or removed from the cluster in real time. MongoDB will automatically rebalance the data as needed without manual intervention.

How does MongoDB ensure high availability?

MongoDB automatically maintains replica sets, multiple copies of data that are distributed across servers, racks and data centers. Replica sets help prevent database downtime using native replication and automatic failover.

A replica set consists of multiple replica set members. At any given time, one member acts as the primary member, and the other members act as secondary members. If the primary member fails for any reason (e.g., hardware failure), one of the secondary members is automatically elected to primary and begins to process all reads and writes.

Learn more in theMongoDB Architecture Guide.

How does MongoDB ensure consistency?

MongoDB is consistent by default: reads and writes are issued to the primary member of a replica set. Applications can optionally read from secondary replicas, where data is eventually consistent by default. Reads from secondaries can be useful in scenarios where it is acceptable for data to be slightly out of date, such as some reporting applications. Applications can also read from the closest copy of the data (as measured by ping distance) when latency is more important than consistency.

Learn more in the MongoDB Architecture Guide.

Is MongoDB schema-less?

No. In MongoDB schema design is still important. MongoDB's document model does, however, employ a different schema paradigm than traditional relational databases. In MongoDB, documents are self-describing; there is no central catalog where schemas are declared and maintained. The schema can vary across documents, and the schema can evolve quickly without requiring the modification of existing data.

MongoDB's dynamic schema also makes it easier to represent semi-structured and polymorphic data, as documents do not all need to have exactly the same fields. For example, a collection of financial trading positions might have positions that are equity positions, and some that are bonds, and some that are cash. All may have some fields in common, but some fields (e.g., 'ticker', “numberofshares”) do not apply to all position types.

With Schema Validation, you have the option to enforce a schema against the data, ensuring the presence of mandatory fields, permissible values, and appropriate data types. When designing schemas in MongoDB, you should consider a number of topics, including the types of queries the application will need to perform, how objects are managed in the application code, and how documents will change and potentially grow over time.

Learn more about schema design:

Should I normalize my data before storing it in MongoDB?

No. Schema design is very important when using MongoDB, but very different from schema design for relational databases.

Learn more about schema design:

How does MongoDB secure my data?

MongoDB features extensive capabilities to defend, detect, and control access to data:

  • Authentication. Simplifying access control to the database, MongoDB offers a strong Challenge-Response mechanism based on SCRAM-256, along with integration to enterprise security infrastructure including LDAP, Windows Active Directory, Kerberos, and x.509 certificates.
  • Authorization. Role-Based Access Control (RBAC) enables you to configure granular permissions for a user or an application based on the privileges they need to do their job.
  • Auditing. For regulatory compliance, security administrators can use MongoDB's native audit log to record all database activity and changes.
  • Encryption Everywhere. MongoDB data can be encrypted while in motion across the network, while in use in the database, and while at rest, whether on disk or in backups.
Review the documentation

to learn more about MongoDB’s security controls. Head to the MongoDB Trust Center to learn more about security in the cloud.

What's new in the MongoDB 4.2 release?

Review the Guide to What's New to learn more.

What is the relationship between MongoDB Realm and MongoDB Stitch?

MongoDB Realm will combine Realm, the popular mobile database and data synchronization technology, and MongoDB Stitch, the serverless platform for MongoDB, into a unified solution that makes it easy for you to build powerful and engaging experiences on more devices. You can learn more here.

Where does the name MongoDB come from?

MongoDB comes from the word humongous. Our founders built large Internet companies like DoubleClick. They consistently ran into the same problems with databases, one of the biggest problems being scalability. When they set out to build MongoDB, they wanted a database that scaled. Thus, “a humongous database,” or MongoDB.

Our founders believe that coding should be natural, and so should using a database. They want the experience of using MongoDB to be simple and natural. Thus, the leaf.