The purpose of this blog is to provide you some clarification about how to choose perfect database for your projects.
Well In terms of data engineering, data pressure is the ability of the system to process the amount of data at a reasonable cost or at a reasonable time. Thus, data pressure plays a very crucial role while working on highly scalable projects.
So, let's see what are the major differences between them:
SQL: Optimized for Storage
NoSQL: Optimized for Compute/Querying
NoSQL: De-normalized (Unnormalized)/Hierarchical
SQL: Table based data structure
NoSQL: Depending on DBs, the data structures are …
★ Key-Values(DynamoDB, Radis, Voldemort)
★ Wide-column i.e. containers for rows(Cassandra, HBase)
★ Collection of Documents(MongoDB, CouchDB, DynamoDB)
★ Graph Structures(Neo4J, InfiniteGraph)
SQL: Scale Vertically & Expensive. Can Scale Horizontally but challenging & time-consuming
NoSQL: Scale Horizontally & Cheap
SQL: Fixed schema, altering requires modifying the whole database
NoSQL: Schemas are dynamic
SQL: Good for OLAP
NoSQL: Good for OLTP at scale
SQL: ACID(Atomicity, Consistency, Isolation, Durability) properties
NoSQL: BASE(Basically Available, Soft state, Eventual consistency) properties
For our application service, when it comes down to
✔ Well-known and well-understood types of access patterns
✔ Want simple queries
✔ Not much data calculation involved
✔ Have a common business process
✔ OLTP apps
If all the above mentioned conditions are required, then NoSQL is a perfect Database and would be most efficient. We have to structure the data model specifically to support the given access pattern.
If our application service has the requirements to support
✔ Ad-hoc queries. e.g. bi analytics use case or OLAP application
✔ May require “reshaping” the data
✔ Complex queries, inner joins, outer joins, etc.
✔ Complex value calculations
then we have to prefer SQL instead of NoSQL as it will be much more efficient as NoSQL.
So basically, if we know about our access patterns and scalability is such a big factor for your application then NoSQL is perfect choice from all sides.