SQL vs No-SQL

12 views
Skip to first unread message

ankurguptajpr

unread,
Apr 25, 2014, 8:03:28 AM4/25/14
to newidea_or...@googlegroups.com


 

For the past 40-some years, relational databases have ruled the data world. Relational models first appeared in the early 1970s.

For the past couple of years, the Internets have been filled with heated arguments regarding SQL vs. NoSQL. But is the fight even legitimate? NoSQL databases have grown up a bit (and some, such as Google’s BigTable, are now mature) and prove themselves worthy. And yet the fight continues.

When people argue “SQL vs NoSQL,” they’re actually talking about relational versus non-relational databases. Relational databases (such as Oracle, MySQL, and SQL Server) versus newer non-relational databases (such as MongoDB, CouchDB, BigTable, and others).

First, here are some arguments against relational databases, the anti-SQL arguments. Now please understand I’m not saying these are necessarily accurate

1.                  Joins in relational databases can slow the system down to a crawl, especially when millions of users are doing lookups against tables with millions of rows of data

2.                  Relational data doesn’t map well to typical programming structures that often consist of complex data types or hierarchical data.

3.                  Relational data doesn’t map well. Combine that with the need to handle the syntax of SQL, and writing client code for accessing SQL databases becomes difficult.

Considering above arguments some where some thought comes in mind, can there be any alternate for SQL?
Answer is yes, No-SQL that means data should be stored in database but without any relationship. Also that should be fast enough to serve the user and industry necessity.

Let’s see what is No-SQL:

NoSQL encompasses a wide variety of different database technologies and were developed in response to a rise in the volume of data stored about users, objects and products, the frequency in which this data is accessed, and performance and processing needs.

Today, three interrelated megatrends – Big Data, Big Users, and Cloud Computing – are driving the adoption of NoSQL technology.



Relational data model takes data and store them in some typical relationship. For that you need few table structure and normalization in place. While retrieving the data back again you need to combine all the tables and return the result which makes response slow. And this was the motivation of No-SQL.

NoSQL Database Types

Document databases pair each key with a complex data structure known as a document. Documents can contain many different key-value pairs, or key-array pairs, or even nested documents.

Graph stores are used to store information about networks, such as social connections. Graph stores include Neo4J and HyperGraphDB.

Key-value stores are the simplest NoSQL databases. Every single item in the database is stored as an attribute name (or "key"), together with its value.

Wide-column stores such as Cassandra and HBase are optimized for queries over large datasets, and store columns of data together, instead of rows.

The Benefits of No-SQL:

When compared to relational databases, NoSQL databases are more scalable and provide superior performance, and their data model addresses several issues that the relational model is not designed to address:

o          Large volumes of structured, semi-structured, and unstructured data

o          Agile sprints, quick iteration, and frequent code pushes

o          Object-oriented programming that is easy to use and flexible

o          Efficient, scale-out architecture instead of expensive, monolithic architecture

 

Dynamic Schemas

NoSQL databases have a very different model.  NoSQL database takes the data you want to store and aggregates it into single documents using the JSON format.

http://www.couchbase.com/sites/default/files/uploads/all/images/WhyNoSQL/Figure5a.png

Major difference is that relational technologies have rigid schemas while NoSQL models are schemaless.
In comparison, document databases are schemaless, allowing you to freely add fields to JSON documents without having to first define changes. 

Auto-Shading:
A NoSQL database automatically spreads data across servers, without requiring applications to participate. Servers can be added or removed from the data layer without application downtime, with data (and I/O) automatically spread across the servers. 

Most NoSQL databases also support data replication, storing multiple copies of data across the cluster, and even across data centers, to ensure high availability and support disaster recovery. A properly managed NoSQL database system should never need to be taken offline, for any reason, supporting 24x365 continuous operation of applications.

Replication:
Most NoSQL databases also support automatic replication, meaning that you get high availability and disaster recovery without involving separate applications to manage these tasks. The storage environment is essentially virtualized from the developer's perspective.

Integrated Caching
 To reduce latency and increase sustained data throughput, advanced NoSQL database technologies transparently cache data in system memory.

 


 

 

Traditional 3 tier application with Centralize DB

3-Trie Application with No-SQL

http://www.couchbase.com/sites/default/files/uploads/all/images/WhyNoSQL/Figure6a.png

http://www.couchbase.com/sites/default/files/uploads/all/images/WhyNoSQL/Figure7a.png

 

 

 

References:

http://news.dice.com/2012/07/16/sql-vs-nosql-which-is-better/

http://www.mongodb.com/nosql-explained

http://www.couchbase.com/why-nosql/nosql-database

Shailendra shail

unread,
May 28, 2014, 6:40:26 AM5/28/14
to newidea_or...@googlegroups.com
This is Good article. Actually we should know NoSQL in depth. Now a day most of companies are migrating from Relational DB to BigData (Hadoop, Cassandra, MongoDB.. etc) because of various reason. 

I think we can start a discussion about any BigData technically (if any one knows). I know few people who has worked in MongoDB (Neo, Aamir, Swapnil), Krishna is having good knowledge of Hadoop and I will request them to put their best view for us. Me/Ankur will try to share some technical stuffs about Cassandra ASAP.


Regards,
Shailendra
Reply all
Reply to author
Forward
0 new messages