MongoDB

MongoDB is a document-oriented NoSQL database used for high volume data storage. MongoDB is a database which came into light around the mid-2000s. It falls under the category of a NoSQL database.

MongoDB Features

  1. Each database contains collections which in turn contains documents. Each document can be different with a varying number of fields. The size and content of each document can be different from each other.
  2. The document structure is more in line with how developers construct their classes and objects in their respective programming languages. Developers will often say that their classes are not rows and columns but have a clear structure with key-value pairs.
  3. As seen in the introduction with NoSQL databases, the rows (or documents as called in MongoDB) doesn’t need to have a schema defined beforehand. Instead, the fields can be created on the fly.
  4. The data model available within MongoDB allows you to represent hierarchical relationships, to store arrays, and other more complex structures more easily.
  5. Scalability – The MongoDB environments are very scalable. Companies across the world have defined clusters with some of them running 100+ nodes with around millions of documents within the database.

Key Components of MongoDB Architecture

  1. _id – This is a field required in every MongoDB document. The _id field represents a unique value in the MongoDB document. The _id field is like the document’s primary key. If you create a new document without an _id field, MongoDB will automatically create the field. So for example, if we see the example of the above customer table, Mongo DB will add a 24 digit unique identifier to each document in the collection.
  2. Collection – This is a grouping of MongoDB documents. A collection is the equivalent of a table which is created in any other RDMS such as Oracle or MS SQL. A collection exists within a single database. As seen from the introduction collections don’t enforce any sort of structure.
  3. Cursor – This is a pointer to the result set of a query. Clients can iterate through a cursor to retrieve results.
  4. Database – This is a container for collections like in RDMS wherein it is a container for tables. Each database gets its own set of files on the file system. A MongoDB server can store multiple databases.
  5. Document – A record in a MongoDB collection is basically called a document. The document, in turn, will consist of field name and values.
  6. Field – A name-value pair in a document. A document has zero or more fields. Fields are analogous to columns in relational databases.
    The following diagram shows an example of Fields with Key value pairs. So in the example below CustomerID and 11 is one of the key value pair’s defined in the document.
  7. JSON – This is known as JavaScript Object Notation. This is a human-readable, plain text format for expressing structured data. JSON is currently supported in many programming languages.

MongoDB parameters within CemTore for Cluster/Application creation.

From MongoDB Atlas account Click Cluster / Connect / Connect your application / C++ / 3.1x or later and copy the link.

The link should be as follow:

mongodb://remy_blanc_91:@clusterusremy-shard-00-00-3hfrs.mongodb.net:27017,clusterusremy-shard-00-01-3hfrs.mongodb.net:27017,clusterusremy-shard-00-02-3hfrs.mongodb.net:27017/test?ssl=true&replicaSet=clusterUSremy-shard-0&authSource=admin&retryWrites=true&w=majority

Follow the steps bellow to create a Cluster and an Application.

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment