Introduction to mongodb


What is mongodb?

->MongoDB (from “humongous”) is an open source, scalable, high-performance, schema-free, document-oriented database written in the C++ programming language.

->MongoDB has a variety of features designed to bridge the gap between key/value stores and and traditional RDBMSes; some of these features are

1.ad hoc querying

2. secondary indexes

3. replication

4. aggregation.

What is Ad hoc queries?

->In MongoDB, any field can be queried at any time. MongoDB supports range queries, regular expression searches, and other special types of queries in addition to exactly matching fields. Queries can also include user-defined JavaScript functions (if the function returns true, the document matches).

Queries can return specific fields of documents (instead of the entire document), as well as sorting, skipping, and limiting results.

What is secondary indexes ?

->By default MongoDB creates index on _id key in document. But when we ensure additional index (secondary like in InnoDB from MySQL) and query it after, engine scans it and then selective scan _id index to get documments offsets.

What is replication ?

->MongoDB supports master-slave replication. A master can perform reads and writes. A slave copies data from the master and can only be used for reads or backup (not writes).

MongoDB allows developers to guarantee that an operation has been replicated to at least N servers on a per-operation basis.

What is aggregatoin ?

->Mongodb database supports a couple of tools for aggregation,like group function similar to SQL’s GROUP BY.

e.g. count(), desticnt(), group()………..

Advertisements

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