Saturday, 14 October 2017

MongoDB Architecture Introduction

Introduction

MongoDB is a NoSQL open-source, document-oriented database. It uses JSON(Java Script Object Notation) like documents, however data is stored in the database in BSON form. In MongaDB document is the basic unit of storage. It doesn't make any sense to call MongoDB as schemaless as there are collections involved in it. But schema design is very important in MongoDB, we can configure dynamic schema

  • 2007 - Company 10gen began developing MongoDB
  • 2009 Shifted to an open source development model and began commercial support and services
  • 2013 - 10gen changed its name to MongoDB Inc

Some Important Files in MongoDB

  • journal - This is like redologs for crash recovery
  • <database>.ns - This is namespace it stores metadata information 
  • <database>.o , <database>.1 - These are the datafiles that stores data

Why use MongoDB? Advantages


  1. It makes development task easy
  2. Can easily scale up horizontally 
  3. Parallelism can be achieved at server or hardware level
  4. Structured, unstructured data can be stored 

Nexus Architecture

MongoDB’s design philosophy is focused on combining the critical capabilities of relational databases with the innovations of NoSQL technologies. 

Expressive query language & secondary Indexes

Users should be able to access and manipulate their data in sophisticated ways to support both operational and analytical applications. Indexes play a critical role in providing efficient access to data, supported natively by the database rather than maintained in application code.

Strong consistency

Applications should be able to immediately read what has been written to the database. It is much more complex to build applications around an eventually consistent model, imposing significant work on the developer, even for the most sophisticated engineering teams.

Enterprise Management and Integrations

Databases are just one piece of application infrastructure, and need to fit seamlessly into the enterprise IT stack. Organizations need a database that can be secured, monitored, automated, and integrated with their existing technology infrastructure, processes, and staff, including operations teams, DBAs, and data analysts.

Flexible Data Model

NoSQL databases emerged to address the requirements for the data we see dominating modern applications. Whether document, graph, key-value, or wide-column, all of them offer a flexible data model, making it easy to store and combine data of any structure and allow dynamic modification of the schema without downtime or performance impact.

Scalability and Performance

NoSQL databases were all built with a focus on scalability, so they all include some form of sharding or partitioning. This allows the database to scale out on commodity hardware deployed on-premises or in the cloud, enabling almost unlimited growth with higher throughput and lower latency than relational databases.

Always-On Global Deployments

NoSQL databases are designed for highly available systems that provide a consistent, high quality experience for users all over the world. They are designed to run across many nodes, including replication to automatically synchronize data across servers, racks, and data centers.