What is noSql
Why Nosql Why not RDBMS
Relational database management system were introduced in 1970s. In those days storing data were very simple and straight forward. Nobody even thought about today’s complex application like facebook or Banking applications. In today’s market user wants to get enough information by click of just single button. Each request by user asks for many database queries in fractions of seconds.Volume of data is increasing day by day so ultimately applications are getting slower and slower.
Today’s Relational database management system are always ask for huge Hardware and power. They really can’t take advantage of cheap hardware and low power.To avoid this issue, today’s Relational database venders like oracle, Microsoft and sybase are using techniques like distributed cache.Which increasing the DATABASE READ performance, but still the DATABASE WRITE performance is lacking.
It means if your application demands High read operation rather than Write operation, then Relational database system is your ultimate choice. if your application demands more READ and WRITE operations on frequently basis then noSQL will be your ultimate choice.
Advantages of NoSql
In RDBMS, before storing data into database we have to design the database tables with defined column and nature of each column in an advanced, which is called schema. Then after we can store data into those database table.If in the midway we have to add 1 more column into a table, so in the same way we have to migrate all existing data into newly change table.This requires even more time.
But in NoSql, there is no need of schema design before storing data.You can directly store data and automatically schema will be prepared.This makes easy to make significant change in your application without even thinking about database scheme change and existing data migration.This makes application development faster.
What is NoSql
NoSql means NON-RDBMS and NOT SQL . It means without writing SQL based create, insert and update statement we can archive the same using simple Object oriented API.In noSql data are stored in the form of key value pair and every noSql database there are two columns like KEY and VALUE. Every complex data will be stored in the VALUE column. Even data can be stored in nested i.e data inside data.The best format of noSql data is binary form JSON i.e BJSON.The most important thing about noSql is its OpenSource.That means you can implement and configure by investing less.
Some of the well known NoSql database are mongoDb, couchDb and cassandra. Some of the well known Developer started developing NoSql database from the year 2000. Company like GOOGLE, FACEBOOK are using nosql since 2009.
If we consider the drawbacks of Relational Database, NoSql is doing well.It never requires high end hardware and huge power consumption.It can spread its data to multiple server in case of new server instance found.There are 4 types of nosql Database in the market like
- Key Value pair Nosql Database (for storing only data like employee information)
- Document Nosql Database (For storing documents like image,word,pdf in database)
- Graph store Nosql Database
- Wide column Nosql Database
Some of companies like Cisco, Metlife, McAfee, Mtv, foursquare are using MongoDB as their noSql database.
Below is a comparison chart between SQL and NoSQL
|SQL Databases||NoSQL Databases|
|Types||Only one type i.e SQL DATABASE||Many different types including key-value stores, document database, wide-column stores, and graph databases|
|Development History||Developed in 1970s||Developed in 2000s to deal with limitations of SQL databases, particularly concerning scale, replication and unstructured data storage|
|Examples||MySQL, Postgres, Oracle Database||MongoDb, Cassandra, couchDb|
|Data Storage Model||Each data will be stored in table as related rows and columns. Even if we are storing data in multiple tables, then we have to USE join operations to retrieve those data.||NoSQL key-value stores function similarly to SQL databases, but have only two columns (“key” and “value”), with more complex information sometimes stored within the “value” columns. Document databases do away with the table-and-row model altogether, storing all relevant data together in single “document” in JSON, XML, or another format, which can nest values hierarchically.|
|Schemas||Structure and data types has to be defined in advance before storing data.||Typically dynamic. Records can add new information on the fly and schema will be generated by the Database server automatically.|
|Development Model||Mix of open-source (e.g., Postgres, MySQL) and closed source (e.g., Oracle Database)||Open-source|
|Data Manipulation||Specific language using Select, Insert, and Update statements, e.g. SELECT fields FROM table WHERE…||Through object-oriented APIs|