ENES

MongoDB

A database that stores each record as a flexible JSON-like document, not a table row.

A collection holding three JSON-like documents with different fields, next to a rigid table with fixed columns

MongoDB is the best-known document database, a kind of NoSQL database. Instead of rows in tables with fixed columns, it stores documents: records that look like JSON, with fields, lists and nested objects. Similar documents live together in a collection, roughly what a table is in SQL.

The appeal is flexibility. A product in an online shop can be one document with its name, price, a list of sizes and an embedded set of reviews, all read in one go. Two documents in the same collection do not need the same fields, so adding a new attribute does not require changing a schema first. Under the hood it stores a binary form of JSON called BSON, and you query it with its own API rather than SQL.

It was first released in 2009 by the company now called MongoDB Inc., and the name comes from "humongous". Since 2018 it is licensed under the SSPL, which the company wrote and which many open-source groups do not consider open source. Most teams today use it through MongoDB Atlas, the company's managed cloud service. Over the years it added features once typical of relational databases, such as multi-document transactions.

Keep in mind

Go deeper

Related terms

More in Data