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.
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.
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.
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.
|
Traditional 3 tier application with Centralize DB |
3-Trie Application with No-SQL |
|
|
|
References:
http://news.dice.com/2012/07/16/sql-vs-nosql-which-is-better/