System Design - SQL and NoSQL

SQL

Structured schema. Data is stored in rows and columns. Each record has fixed schema. Columns must designed before data entry. Alternating data structure involves modifying whole database. Uses SQL query. True ACID transaction. Vertical salable. Reasons for SQL: Ensure ACID compliance, such as Bank data; Data is structured and unchanging.

NoSQL

Schema is dynamic. Columns can be added on the fly. Data is demoralized, and thus lack true ACID traction and favor eventual consistency. Horizontal salable. Reasons for NoSQL: Large volume data with little or no structure; Cloud computing; Rapid development.

Selection consideration:

Whether SQL query is required? SQL is better than NoSQL if SQL query is required Development Efficientcy ? Web framework has ORM with SQL, could reduce codes. Transaction ? NoSQL doesnot support transaction QPS reqirment ? SQL is not as good as NoSQL. MySQL could go ~1k, but MongoDB could go ~10k Scalability: NoSQL is better than SQL

UNQL

Horizontally scalable. Sacrifice ACID compliance for performance and scalability. Cloud based computing and storage.

Written on May 20, 2021