# SQL vs NoSQL

| SQL | NoSQL |
| --- | --- |
| SQL, which stands for “Structured Query Language,” is the programming language that’s been widely used in managing data in relational database management systems (RDBMS). | NoSQL stands for "not only SQL," and refers to a non-relational or distributed database. NoSQL databases use a variety of data models, such as key- value, document, columnar, and graph. |
| SQL databases are best suited for structured and predictable data. | NoSQL databases are better for unstructured and rapidly changing data. |
| SQL databases are not suited for hierarchical data storage. | No SQL databases are best suited for hierarchical data storage. |
| SQL databases are often used for transactions and complex queries. | NoSQL databases are used for big data and real-time web applications. |
| SQL databases, such as MySQL, Oracle, and Microsoft SQL Server, have a fixed schema, meaning the structure of the database is defined in advance and cannot be changed easily. | NoSQL (Not only SQL) databases, on the other hand, do not have a fixed schema and are often used to handle large amounts of unstructured or semi- structured data. |
| In almost all situations SQL databases are vertically scalable. This means that you can increase the load on a single server by increasing things like RAM, CPU or SSD. | NoSQL databases are horizontally scalable. This means that you handle more traffic by sharding, or adding more servers in your NoSQL database. |
| SQL databases follow ACID properties (Atomicity, Consistency, Isolation and Durability). | NoSQL database follows the Brewers CAP theorem (Consistency, Availability and Partition tolerance). |
| Examples: MySQL, PostgreSQL, Oracle, MS-SQL Server, etc. | Examples: MongoDB, GraphQL, HBase, Neo4j, Cassandra, etc. |
