Saturday, February 1, 2014

What is NoSQL?

Let us start with Databases. A simplistic view of Databases is that it stores data which can be read, updated and deleted at a later time. This data can represent multiple things depending on the application using it and the data itself can be stored in multiple ways as well. For example your application can serialize the objects and store them, save the object state and values in a xml file or some other format. One format that really took off was Relational Databases, where you store the data explicitly in tables and some information about it implicitly through relation between those tables.
Relational Databases became so popular that we started using them for almost everything, they are used for data flows, integrations etc. But what happened to the other forms of storing data?

Enter NoSQL

All other forms of data storage are now grouped under this weird name 'NoSQL databases'. So the best way to define a NoSQL database would be "Not a relational Database". If you come up with a new way of storing and retrieving data it would come under NoSQL database as long as it is Not a relational model.

  • Key Value: As the name suggests, store and retrieve the data (Value) using key.
  • Document Store: If the value you store is a document (xml, JSON etc.). 
  • Data-structure: Representing data in the form of a data structure and storing it.
  • Graph: Representing data in the form of a graph data structure and storing the graph.

Why NoSQL?

You might be thinking, so why should I care about NoSQL databases. Here are couple of reasons why:
  • In general NoSQL databases perform much better when you have to load a large amount of data (data insertion is faster).
  • NoSQL databases can easily to scale out (scale horizontally) compared to Relational DB.
  • In certain cases they are just natural fit for the type of data being stored (e.g. JSON, XML, graph etc.)