MongoDB – Introduction

It is leading NoSQL database. It is an open-source document database. It is written in c++. It provides high performance, high availability, and easy scalability. It works on concept of collection and document.

Database -> Collection -> Document -> Key & Value

A single MongoDB server typically has multiple databases.

Database is a physical container for collections.

Collection is a group of MongoDB documents.

Document is a set of key-value pairs and has dynamic schema.

There is a _id for assuring of the uniqueness of every document. _id is a 12 bytes hexadecimal number. MongoDB generates _id for each document if not supplied. These 12 bytes first 4 bytes for the current timestamp, next 3 bytes for machine id, next 2 bytes for process id of mongodb server and remaining 3 bytes are simple incremental value.

4 Bytes 3 Bytes 2 Bytes 3 Bytes
Current Timestamp Machine ID Process ID Simple Incremental Value

MongoDB – Commands

Vikas Jindal

Advertisements

One thought on “MongoDB – Introduction

  1. Pingback: MongoDB – Commands | vikkasjindal

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s