Computer scienceFundamentalsSQL and DatabasesDBMSMongoDBIntroduction to MongoDB

What is MongoDB

3 minutes read

MongoDB is a document-oriented database used for storing and processing huge amounts of data. The name comes from the word "humongous" which highlights the key value of this database.

mongodb logo

The MongoDB logo

Classified as a NoSQL database, MongoDB consists of schemaless JSON-based documents which are handy to represent complex data and leverage all the possibilities provided by the flexibility of the JSON format.

According to the DB-Engines Ranking, MongoDB is one of the most popular databases, and it is the top one among other NoSQL databases. Learning about MongoDB and its features is useful for any developer who keeps up with modern programming technologies and Big Data.

Features

MongoDB has a number of features that make it a sought-after database for developers. Here are some of the crucial ones:

  • All data in MongoDB is stored as JSON documents (though technically, in binary JSON format – BSON) grouped by collections.

  • Collections don't have to have a similar structure. For example, documents in the same collection may have different fields. One document can have fields of different data types, the data does not need to be reduced to the same type.

  • The data model in MongoDB allows you to easily represent complex hierarchical structures as well as store arrays.

  • MongoDB is intentionally developed as a highly scalable and fault-tolerant database for large amounts of data. To achieve it, MongoDB should be run in a cluster environment where several connected databases work together. However, it is possible to start only a single instance. It can be useful while developing, experimenting, or learning to work with MongoDB.

These and other features make MongoDB useful in projects that need to handle big data, user data management, content, and delivery. It is well suited for high-performance distributed web applications such as Amazon or eBay. MongoDB supports all popular programming languages and can be used for free as an open-source solution.

Installation

MongoDB can run on different platforms: macOS, Linux, Windows, or inside Docker. You can find a guide on how to install MongoDB on the official website.

After installing, check the installed version by running the mongod --version command in the terminal. It will show you something like this:

mongod --version
db version v8.0.13

If you get the version number after running the command, it means that your installation was successful and you can start using MongoDB.

Conclusion

In this topic, we've introduced you to the document-oriented MongoDB database. You've learned about its crucial features, installed the database and learned how to check its version in the terminal. Good news for those who do not like to use the terminal: in addition to the console, later you can use a specialized graphical client Compass to work with MongoDB. Using Compass will allow you to manage data, add, modify, and delete it. Good luck with your studies and the tasks ahead!

51 learners liked this piece of theory. 0 didn't like it. What about you?
Report a typo