SQL | NoSQL |
---|---|
RDBMS | Non-relational/distributed database |
Table-based | Document-based (various schema) |
Vertically scalable | Horizontally scalable |
Complex queries | Weaker queries |
Wide availability of support | Limited support sources |
SQL: (often pronounced like “Sequel”) Structured Query Language– A language that is used to write queries for management of data in a database (modification, deletion, insertion, retrieval). SQL is based around a table structure for all data.
Database schema– the defined fields within data that all data within the DB must conform to.
SQL is relational- it uses multiple tables of data that may be distinguished by schema but can be compared, connected, and cross-referenced. (example:one-to-one or one-to-many relation of one data point to fields in other tables)
SQL is appropriate for normalized, distributed data.
SQL can only effectively scale vertically– by adding more computing power.
NoSQL: NoSQL consists of data “collections” rather than tables, and no schema is enforced on data within the same collection.
NoSQL is appropriate for large and potentially changable data sets within the same database.
Real world examples: A long-term data collection project where new parameters might be added over time for the same compared subjects.
NoSQL can scale horizontally– by adding parallel server storage for more data in addition to vertically.
NoSQL can outperform SQL for rapid but uncomplicated read/write requests.
Less efficient for data sets where very few fields are consistently read or written
Data is stored in documents that use flexible key-value pairs similar to JSON files.
Which type of database is best for hierarchical data storage?