Difference between SQL and NoSQL

In this article let us see about basic differences between SQL and NoSQL and try to understand the structure of both database models.

 SQLNoSQL
Data ModelRelational model.Structured database. Stores data in tablesNon-Relational model. Semi-Structured database. Stores data in JSON documents, graphs, key value pairs, column based.
Query LanguageStructured Query LanguageNo declarative query language.
SchemaPredefined or StaticDynamic
Popular Database SystemsMySQL, PostgreSQL, Oracle, MS-SQLMongoDB, Apache HBase, Cassandra, Amazerticalon DynamoDB
ScalingVerticalHorizontal
TransactionACID (Atomicity, Consistency, Isolation, Durability)BASE (Basically Available, Soft state, Eventual Consistency)
FlexibilityNot very flexible in terms of designVery flexible in terms of design
ExampleSELECT id, name, address FROM students WHERE age>12 LIMIT 5db.students.find( {age:{$gt:18}}, {name:{1,address:1} ).limit(5)

Relational

SQL
NoSQL

In the above images we can understand the models of SQL and NoSQL databases.

If your application has fixed structure and does not require frequent modifications  then SQL is best. But if your application is rapidly changing and growing like in big data analytics then NoSQL is best.