SQL vs NoSQL DB

Relational Databases (SQL)

Are structured and have predefined schemas.

Non-relational Databases

Are unstructured, distributed and have a dynamic schema.

High level differences

PropertySQLNoSQL
StorageData stored in tablesDifferent data storage models such as document, key-value, graph and column-oriented (used mainly for analytics)
SchemaFixedDynamic
QuerySQL languagequeries based on documents and have different syntax/DSL by DB
ScalabilityVerticalHorizontal
ReliabilityACIDNon-ACID for performance and scalability

Reasons

For SQL

  • Structured data with strict schema
  • Relational data
  • Need for complex joins
  • Transactions
  • Lookups by index are very fast

For NoSQL

  • Dynamic or flexible schema
  • Non-relational data
  • No need for complex joins
  • Very data-intensive workload
  • Very high throughput for IOPS