SQL | NoSQL |
---|---|
SQL databases are table based databases | NoSQL databases are document based |
SQL databases have predefined schema | databases have dynamic schema for unstructured data |
SQL databases are vertically scalable | NoSQL databases are horizontally scalable |
SQL databases are not best fit for hierarchical data storage | NoSQL database fits better for the hierarchical data storage as it follows the key-value pair way of storing data similar to JSON data |
SQL databases are vertically scalable. You can manage increasing load by increasing the CPU, RAM, SSD, etc, on a single server. On the other hand | NoSQL databases are horizontally scalable. You can just add few more servers easily in your NoSQL database infrastructure to handle the large traffic. |
SQL databases are good fit for the complex query intensive environment
NoSQL databases are not good fit for complex queries. On a high-level
NoSQL database fits better for the hierarchical data storage as it follows the key-value pair way of storing data similar to JSON data. NoSQL database are highly preferred for large data set (i.e for big data). Hbase is an example for this purpose.
NoSQL databases
Structured Query Language
is a type of database that stores and provides access to data points that are related to one another
is the organization or structure for a database,
database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases
One way of understanding the appeal of NoSQL databases from a design perspective is to look at how the data models of a SQL and a NoSQL database might look in an oversimplified example using address data.
MongoDB stores data records as documents (specifically BSON documents) which are gathered together in collections. A database stores one or more collections of documents.
MongoDB offers faster query processing but with an increased load and system requirements. Without knowing the purpose of use, it is not possible to classify SQL Databases or NoSQL Databases like MongoDB as better or worse than the other.
SQL is better
NoSQL databases don’t have the reliability functions which Relational Databases have (basically don’t support ACID).
NoSQL are very new compared to Relational Databases, which means that are far less stable and may have a lot less functionalities
NoSQL is not compatible (at all) with SQL