SQL Databases | NoSQL Databases |
Relational databases accessed with SQL (Structured Query Language) were developed in the 1970s with a focus on reducing data duplication as storage was much more costly than developer time. SQL databases tend to have rigid, complex, tabular schemas and typically require expensive vertical scaling. | NoSQL (“non SQL” or “not only SQL”) databases were developed in the late 2000s with a focus on scaling, fast queries, allowing for frequent application changes, and making programming simpler for developers |
Relational — database is structures, data organized in tables. Tables have primary/foreign key relationships. | Non-relational — document-oriented. There are no tables, rows, primary keys or foreign keys. MongoDB, Cassandra, Redis are popular NoSQL databases. |
Tables with fixed rows and columns | Types: Document: JSON documents, Key-value: key-value pairs, Wide-column: tables with rows and dynamic columns, Graph: nodes and edges |
Document: general purpose, Key-value: large amounts of data with simple lookup queries, Wide-column: large amounts of data with predictable query patterns, Graph: analyzing and traversing relationships between connected data | |
Cannot be distributed. Vertical (scale-up with a larger server). | Can be distributed. Horizontal (scale-out across commodity servers). |