SQL vs. NoSQL

SQL vs. NoSQL


SQL vs. NoSQL

Common types of NoSQL

Key-value stores

  • Array of key-value pairs. The "key" is an attribute name.
  • Redis, Vodemort, Dynamo.

Document databases

  • Data is stored in documents.
  • Documents are grouped in collections.
  • Each document can have an entirely different structure.
  • CouchDB, MongoDB.

Wide-column / columnar databases

  • Column families - containers for rows.
  • No need to know all the columns up front.
  • Each row can have different number of columns.
  • Cassandra, HBase.

Graph database

  • Data is stored in graph structures
    • Nodes: entities
    • Properties: information about the entities
    • Lines: connections between the entities
  • Neo4J, InfiniteGraph

Differences between SQL and NoSQL

Storage

  • SQL: store data in tables.
  • NoSQL: have different data storage models.

Schema

  • SQL
    • Each record conforms to a fixed schema.
    • Schema can be altered, but it requires modifying the whole database.
  • NoSQL:
    • Schemas are dynamic.

Querying

  • SQL
    • Use SQL (structured query language) for defining and manipulating the data.
  • NoSQL
    • Queries are focused on a collection of documents.
    • UnQL (unstructured query language).
    • Different databases have different syntax.

Scalability

  • SQL
    • Vertically scalable (by increasing the horsepower: memory, CPU, etc) and expensive.
    • Horizontally scalable (across multiple servers); but it can be challenging and time-consuming.
  • NoSQL
    • Horizontablly scalable (by adding more servers) and cheap.

ACID

  • Atomicity, consistency, isolation, durability
  • SQL
    • ACID compliant
    • Data reliability
    • Gurantee of transactions
  • NoSQL
    • Most sacrifice ACID compliance for performance and scalability.

Which one to use?

SQL

  • Ensure ACID compliance.
    • Reduce anomalies.
    • Protect database integrity.
  • Data is structured and unchanging.

NoSQL

  • Data has little or no structure.
  • Make the most of cloud computing and storage.
    • Cloud-based storage requires data to be easily spread across multiple servers to scale up.
  • Rapid development.

    • Frequent updates to the data structure.

About the Author

Software Engineer

1 comment

  1. Key Differences between SQL and NoSQL
    SQL pronounced as “S-Q-L” or as “See-Quel” is primarily called RDBMS or Relational Databases, whereas NoSQL is a Non-relational or Distributed Database.
    Comparing SQL vs NoSQL databases, SQL databases are table-based databases, whereas NoSQL databases can be document-based, key-value pairs, and graph databases.
    SQL databases are vertically scalable, while NoSQL databases are horizontally scalable.
    SQL databases have a predefined schema, whereas NoSQL databases use a dynamic schema for unstructured data.
    Comparing NoSQL vs SQL performance, SQL requires specialized DB hardware for better performance while NoSQL uses commodity hardware.


    What is SQL?
    Structured Query language (SQL) pronounced as “S-Q-L” or sometimes as “See-Quel” is the standard language for dealing with Relational Databases. A relational database defines relationships in the form of tables.

    SQL programming can be effectively used to insert, search, update, delete database records.

    That doesn’…
Enter your comments here...
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
Site is Blocked
Sorry! This site is not available in your country.