What is MongoDB ??
MongoDB is a NoSQL (Not Only SQL) database that is used to efficiently handle enormous amounts of data. It is open source and is used as an alternative to standard databases in the development of large enterprise systems that handle massive amounts of data. It was created using the C++ programming language. It is cross-platform and is a document-oriented database. MongoDB stores and retrieves data in the Binary JavaScript Object Notation (BSON) format. Many organizations utilize MongoDB because of its capabilities and benefits, which aid their businesses by lowering expenses.
MongoDB is made up of three basic parts:-
- Database
- Collections
- Documents
Database -> A database is a collection of data that works as
physical storage. The database is represented by the code_builders_hut in the image above.
Collections -> These are groups of documents. This is analogous to the table structure of a relational database. The collection is represented by the users in the above image.
Documents -> In MongoDB, these are the fundamental building pieces of a database. The image above is an example of a document. The data is saved as Key-value pairs and supports various data types. These are analogous to the rows found in a SQL table, which is used in relational databases.
MongoDB has the following characteristics:
- It can manage both structured and unstructured data
- It is horizontally scalable and cost-effective
- It supports ad-hoc queries (able to perform a search using regex/field/query to get results)
- It has indexes that improve the performance of the search operation in retrieving data.