May 19, 2014

Introduction to MongoDB

MongoDB is an open source non-relational JSON store. It does not store data in relational tables, it is schema less.

MongoDB is document oriented and has dynamic schema. It does not support joins and does not have transaction against multiple document.

JSON (Java Script Object Notation) is the way we express data inside MongoDB.

JSON (Java Notation Object Notation):

JSON is light-weight data-interchange format. There are two basic data structure inside JSON:
1)  Array - Lists of things
2) Dictionaries - Associated Maps

These can be combined in arbitrary ways. Array inside JSON is represented inside square brackets and list of items in between. E.g; [...]. Whereas Dictionaries are represented inside curly brackets and its a bunch of key and value pairs. E.g; {keyword:value}. The arbitrary number separated by commas.

For more: http://json.org/

The JSON document is composed of field and value pairs. The value may consists of other documents, arrays or arrays of documents. There will be unique identifier called ObjectID.

For Example:

{Name: "Avesh", Sex: "Male", Group: ["Developer", "Analyst"]}

MongoDB provides high performance, high availability and automatic scaling.

High Performance:

MongoDB provides high performance data persistence. Supports for embedded data models reduces I/O activity on database system. Indexes support faster queries and can include keys from embedded documents and arrays.

High Availability:

MongoDB provides high availability with the help of MongoDB's replication facility, called replica sets. This replica sets provides automatic failoverand data redundancy.

Replica set is agroup of MongoDB servers that maintain the same data set, providing redundancy and increasing data availability.

Automatic Scaling:

MongoDB provides horizontal scalability as a part of its core functionality such as automatic sharding distributes data across a cluster of machines and replica sets can provide eventually-consistent reads for low-latency high throughput deployments.


The latest version of MongoDB can be found on:

http://www.mongodb.org/downloads

Source:
http://docs.mongodb.org/manual/core/introduction/

No comments: