What are NoSql databases and types of NoSql databases along with their comparison

NoSql databases provides a mechanism to store and retrieve data in a flexible manner than traditional RDBMS. NoSql means Not Only Sql which means it provides more capabilities than sql.

Some of the features of NoSql databases are non-relational, distributed, open-source and horizontally scalable.

Types of NoSql databases

Different type of NoSql databases are -

1. Key-Value

2. Column Family

3. Document Oriented

4. Graph Oriented

1. Key-Value

Key-Value database is similar to HashTable or HashMap in java. e.g.

Name Test
Age 28
City New Delhi

You will observe that you have a value (right) corresponding to a key (left). Please note that it can be a string, int, or the like. Most Key-Value pair objects allow you to store any object on the right, because it's just a value. 

Since you'll always have a unique key for a particular object that you want to return, you can just query the database for that unique key and get the results back from whichever node has the object.

Key-value systems basically support get, put, and delete operations based on a primary key.

E.g. of Key-Value databases are DynamoDB,Redis,LevelDB

2. Column family

It was primarily created to store and process large amount of data distributed over many machines. There are still keys but they point to multiple columns.

As per wikipedia "A column family is a NoSQL object that contains columns of related data. It is a tuple (pair) that consists of a key-value pair, where the key is mapped to a value that is a set of columns. In analogy with relational databases, a column family is like a "table", each key-value pair being a "row".[1] Each column is a tuple (triplet) consisting of a column name, a value, and a timestamp.[2] In a relational database table, this data would be grouped together within a table with other non-related data." 

Column-oriented systems still use tables but have no joins (joins must be handled within your application). Obviously, they store data by column as opposed to traditional row-oriented databases. This makes aggregations much easier

E.g. of Column family databases are Cassandra (initially developed by Facebook), HBase. It can be used for storing/processing data like log data etc.

3. Document oriented


Document-oriented systems store structured "documents" such as JSON or XML but have no joins (joins must be handled within your application). It's very easy to map data from object-oriented software to these systems. Document Databases were inspired by Lotus Notes.

As per wikipedia "The central concept of a document-oriented database is the notion of a Document. While each document-oriented database implementation differs on the details of this definition, in general, they all assume documents encapsulate and encode data (or information) in some standard formats or encodings. "

example
 {
     FirstName:"Surender Kumar",
     Address:"Noida",
     Hobby:"Playing Chess"
  }
  
E.g. of document oriented database are MongoDB,CouchDB etc. 

4. Graph database

Graph Databases are built with nodes, relationships between notes and the properties of nodes mainly used for cyclic relationships. Instead of tables of rows and columns and the rigid structure of SQL, a flexible graph model is used which can scale across many machines.


e.g. of Graph database are Neo4J

Comments

Post a Comment

Popular posts from this blog

Brief guide to ecommerce

CQ - How to set replication automatically from Author instance to publisher instance

New age career opportunities in Information Technology after graduation