Monday, October 27, 2014

Introduction to mongoDB

Introduction to mongoDB
MongoDB is a document database that provides high performance, high availability, and easy scalability.
or
MongoDB is an open-source document database that provides high performance, high availability, and automatic scaling.

-1-Document Database
A record in MongoDB is a document, which is a data structure composed of field and value pairs. MongoDB documents are similar to JSON objects. The values of fields may include other documents, arrays, and arrays of documents.
A MongoDB document.
A MongoDB document.
--The advantages of using documents are:
Documents (objects) map nicely to programming language data types.
Embedded documents and arrays reduce need for joins.
Dynamic schema makes polymorphism easier.


-2-High Performance
Embedding makes reads and writes fast.
Indexes can include keys from embedded documents and arrays.
Optional streaming writes (no acknowledgments).

i.e MongoDB provides high performance data persistence. In particular,
-Support for embedded data models reduces I/O activity on database system.
-Indexes support faster queries and can include keys from embedded documents and arrays.


-3-High Availability
Replicated servers with automatic master failover, 
i.e To provide high availability, MongoDB’s replication facility, called replica sets, provide:
--automatic failover.
--data redundancy.
A replica set is a group of MongoDB servers that maintain the same data set, providing redundancy and increasing data availability.

-4-Easy Scalability( or automatic scaling)
Automatic sharding distributes collection data across machines.
MongoDB provides horizontal scalability as part of its core functionality.
Eventually-consistent reads can be distributed over replicated servers. i.e Replica sets can provide eventually-consistent reads for low-latency high throughput deployments.

-5-Advanced Operation
With MongoDB Management Service (MMS) MongoDB supports a complete backup solution and full deployment monitoring.


#~~#Key MongoDB Features
MongoDB focuses on flexibility, power, speed, and ease of use:
--Flexibility
MongoDB stores data in JSON documents (which we serialize to BSON). JSON provides a rich data model that seamlessly maps to native programming language types, and the dynamic schema makes it easier to evolve your data model than with a system with enforced schemas such as a RDBMS.
--Power
MongoDB provides a lot of the features of a traditional RDBMS such as secondary indexes, dynamic queries, sorting, rich updates, upserts (update if document exists, insert if it doesn’t), and easy aggregation. This gives you the breadth of functionality that you are used to from an RDBMS, with the flexibility and scaling capability that the non-relational model allows.
--Speed/Scaling
By keeping related data together in documents, queries can be much faster than in a relational database where related data is separated into multiple tables and then needs to be joined later. MongoDB also makes it easy to scale out your database. Autosharding allows you to scale your cluster linearly by adding more machines. It is possible to increase capacity without any downtime, which is very important on the web when load can increase suddenly and bringing down the website for extended maintenance can cost your business large amounts of revenue.
--Ease of use
MongoDB works hard to be very easy to install, configure, maintain, and use. To this end, MongoDB provides few configuration options, and instead tries to automatically do the “right thing” whenever possible. This means that MongoDB works right out of the box, and you can dive right into developing your application, instead of spending a lot of time fine-tuning obscure database configurations.

#~~#Operations:
--MongoDB is a server process that runs on Linux, Windows and OS X. It can be run both as a 32 or 64-bit application. We recommend running in 64-bit mode, since MongoDB is limited to a total data size of about 2GB for all databases in 32-bit mode.
--The MongoDB process listens on port 27017 by default (note that this can be set at start time - please seemongod options for more information).
--Clients connect to the MongoDB process, optionally authenticate themselves if security is turned on, and perform a sequence of actions, such as inserts, queries and updates.
--MongoDB stores its data in files (default location is /data/db/), and uses memory mapped files for data management for efficiency.
--MongoDB can also be configured for data replication.
--Additionally the MongoDB Management Service (MMS) application for managing MongoDB clusters using a simple user interface. MMS provides backup and monitoring. MMS is available to all users in the cloud and on-premises as part of MongoDB Standard and Enterprise Subscriptions.

No comments:

Post a Comment