SQL vs NoSQL

 

How did we approach it ? what did we consider ?

When it comes to choosing a database, one of the biggest decisions is picking a relational (SQL) or non-relational (NoSQL) data structure. While both are viable options, there are certain key differences between the two that users must keep in mind when making a decision.

Dimensions we looked at from the perspective of the database : Language + Scalability + Structure + adaption + Cost

We approached it in a way so that we can understand the real complexity behind this decision, We had to think about this little differently because it involves organization and how it can be adopted, whether it is going to be cost effective, can it be scalable, Will it fit the need of the application. 

There are certain instances that we found that no SQL databases that are managed databases from any cloud provider (Azure, AWS or GCP) are more expensive than traditional SQL databases. In another instant that better suited candidate is the no SQL database, therefore it is always a balance that we have to act in selecting the right database. 

Most of the time that architects get into trouble when they are wowed by the new technology in front of them and how to use it, than thinking about the cost and other implications. You can't blame the architects because they are always going to be the one who want to use the new and the shiny thing in front of them. 

How do we change the mindset so that we can see beyond the shininess of the solution to see the real implications of implementing the given technology. Approach is going to be simple understand the differences.

SQL vs NoSQL: High-Level Differences

  • SQL databases are primarily called as Relational Databases (RDBMS); whereas NoSQL database are primarily called as non-relational or distributed database.
  • SQL databases are table based databases whereas NoSQL databases are document based, key-value pairs, graph databases or wide-column stores. This means that SQL databases represent data in form of tables which consists of n number of rows of data whereas NoSQL databases are the collection of key-value pair, documents, graph databases or wide-column stores which do not have standard schema definitions which it needs to adhered to.
  • SQL databases have predefined schema whereas NoSQL databases have dynamic schema for unstructured data.
  • SQL databases are vertically scalable whereas the NoSQL databases are horizontally scalable. SQL databases are scaled by increasing the horse-power of the hardware. NoSQL databases are scaled by increasing the databases servers in the pool of resources to reduce the load.
  • SQL databases uses SQL ( structured query language ) for defining and manipulating the data, which is very powerful. In NoSQL database, queries are focused on collection of documents. Sometimes it is also called as UnQL (Unstructured Query Language). The syntax of using UnQL varies from database to database.
  • SQL database examples: MySql, Oracle, Sqlite, Postgres and MS-SQL. NoSQL database examples: MongoDB, BigTable, Redis, RavenDb, Cassandra, Hbase, Neo4j and CouchDb
  • For complex queries: SQL databases are good fit for the complex query intensive environment whereas NoSQL databases are not good fit for complex queries. On a high-level, NoSQL don’t have standard interfaces to perform complex queries, and the queries themselves in NoSQL are not as powerful as SQL query language.
  • For the type of data to be stored: SQL databases are not best fit for hierarchical data storage. But, 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.
  • For scalability: In most typical situations, 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.
  • For high transactional based application: SQL databases are best fit for heavy duty transactional type applications, as it is more stable and promises the atomicity as well as integrity of the data. While you can use NoSQL for transactions purpose, it is still not comparable and sable enough in high load and for complex transactional applications.
  • For support: Excellent support are available for all SQL database from their vendors. There are also lot of independent consultations who can help you with SQL database for a very large scale deployments. For some NoSQL database you still have to rely on community support, and only limited outside experts are available for you to setup and deploy your large scale NoSQL deployments.
  • For properties: SQL databases emphasizes on ACID properties ( Atomicity, Consistency, Isolation and Durability) whereas the NoSQL database follows the Brewers CAP theorem ( Consistency, Availability and Partition tolerance )
  • For DB types: On a high-level, we can classify SQL databases as either open-source or close-sourced from commercial vendors. NoSQL databases can be classified on the basis of way of storing data as graph databases, key-value store databases, document store databases, column store database and XML databases.

https://www.linkedin.com/in/mindil20031/


Comments

  1. Mindika : This is a great article about SQL vs No SQL, Please write more.

    ReplyDelete
  2. Mindika Dharmabandu : also I agree with SQL vs NoSQL: High-Level Differences

    ReplyDelete
  3. Mindika : Excellent breakdown, Your explanations were clear and easy to understand.

    ReplyDelete
  4. Mindika: The manner in which the information about SQL and NoSQL is presented is clear and educational.

    ReplyDelete
  5. Mindika: Very useful article. Thank you for sharing!

    ReplyDelete

Post a Comment

Popular posts from this blog

Mindika Bio

Google APP Engine Changed Our Lives