Skip to content

Notes on science, software and the craft of support

Martin EvansNotes and resources

Databases

MongoDB and document databases

MongoDB is a document oriented NoSQL database that stores flexible JSON like documents and scales across many servers.

MongoDB is a popular NoSQL database that has been around for more than a decade. It is a document oriented database, which means it stores data in documents rather than in traditional rows and columns. It is open source and provides high scalability, availability and performance.

MongoDB uses a document oriented data model, which means that documents are stored in collections. These documents are essentially JSON like structures that contain key and value pairs. A single document can contain multiple fields and subdocuments, and the data structure can vary from document to document. That allows for a much more flexible data model than traditional relational databases.

Scale and query

One of the main advantages of MongoDB is that it is highly scalable. It can scale up or down depending on the size of the data set. MongoDB also provides sharding, which allows data to be partitioned across multiple servers. That helps teams manage large data sets efficiently.

MongoDB also provides a rich query language that allows complex operations on data. It includes an aggregation framework for analysing data and creating reports.

MongoDB is designed for high availability, so it can continue to operate even if one node fails. Replication keeps copies of the data on more than one server, and the system can promote a healthy copy when needed. For applications that need a flexible data model and a database that can grow across machines, MongoDB is a strong option.