NOSQL

Database plays a prominent role in application, data means a lot for an enterprise application. Before emerging of NOSQL, Relational Schema used widely to maintain and process database in application. But developer faced lots of hard situations in Relational Schema.

Why NOSQL ?

  • NOSQL design to run on clusters efficiently than Relational Schema
  • It’s an open source and plenty of tools are available as open source
  • It is not using the relational model and most importantly it is schemaless.

There are number of NOSQL database that are ruling the industry. Key Value Pairs, Column Family Stores, Graph databases, Document Databases can be called as main categories of nosql databases according to their characters. Among them Riak,cassandra, mongoDB are some popular databases belong to above categories.

NoSQL got a big welcome by the industries and as well as Business leads, as it completely supports cloud databases there is no need to maintain a large db server by our own. Even a small scope business can also use an enterprise application developed by nosql databases. It save economy, speed of transactions and availability increases.

When we consider about disadvantage of NOSQL, most importantly it suits best for small scale systems. Also it is not well structured as relational schema. So when we have large complicated databases it is best to going for traditional relational databases.

Let’s discuss about MongoDB as an example for NOSQL,

MONGO DB

Mongo DB is a general purpose document based database platform that is used to build modern enterprise systems.

Mongo DB built around three core principles,

  1. The Document data Model
  2. A distributed system design
  3. Freedom to run anywhere

There are so many interesting facts about mongo DB, Mongo db uses its own methods of code and here after no worries about complicated SQL queries and most importantly mongoDB use collections instead of tables.All the data we are working with will be saved in particular collection we defined. And also it built on distributed architecture system which allow developers to easily scale or modify the database functionality. Mongo DB supports transaction in very little I/O cost, that’s why simple scale enterprise application are often developed using MongoDB.

So let’s see how to work with mongo DB,

Let’s get Started

So first of all if you haven’t install MongoDB in your PC, go to the official mongoDB page and download version you love to work with. If you need to install all the data you are working with you can specifically change storage path as your wish. MongoDB have all the server based services and cloud based database. Here we are looking at how to work with MongoDB as a server. By the following way you can initially change your data saving path and MongoDB log path by giving the paths you want to use. Then to start MongoDB you have to run the net start MongoDB

To get into MongoDB shell simply type mongo , now you are in the mongo shell it means you are ready to work.

As I mentioned before mongoDB doesn’t work like relational databases, it works with collection and save data as document based. So here when we work with mongo we won’t need to worry about SQl anymore. But we have to familiar with mongo shell commands to work with mongo db. The bellow picture illustrate couple of mongo functions used to view databse, create database, create collection, inser and update collection.

In here collection will automatically captures the alterations , no need to alter collections like tables

So this is how to working with mongoDB in the shell. It provides simple functions to deal with database. There are much more functions available in mongo to handle data. You can refer them in MongoDB official page

url : https://docs.mongodb.com/manual/reference/

Leave a comment

Design a site like this with WordPress.com
Get started