Document-oriented databases are one type of NoSQL database, where the information is kept as a key/value store. MongoDB is such a database program. Spring Data MongoDB, as part of the larger Spring Data umbrella project, facilitates the interaction of Java programs with MongoDB document databases.
MongoDB is an open source, document-oriented NoSQL database. MongoDB uses JSON-like documents to store the information, and it uses the concepts of databases, collections, and documents.
- Database—A database represents a container for collections. After installing MongoDB, you will generally get a set of databases.
- Collection —A collection is similar to a table in the world of relational database management systems (RDBMSs). A collection may contain a set of documents.
- Document—A document represents a set of key/value pairs, equivalent to rows in RDBMSs. Documents belonging to the same collection may have different sets of fields. Fields that are common to multiple documents in a collection may contain data of different types—such situations are known as dynamic schemas.
Table 17.1 summarizes the terminology equivalences between relational databases and the NoSQL database MongoDB.