SQL vs NoSQL
- What is the difference between SQL and NoSQL databases?
| Feature | SQL (Relational) | NoSQL (Non-Relational) |
|---|---|---|
| Data Model | Tables with rows & columns | Document, key-value, graph, column-family |
| Schema | Fixed, predefined | Flexible, dynamic |
| Scaling | Vertical scaling (bigger servers) | Horizontal scaling (more servers) |
| Transactions | Strong ACID compliance | Often eventual consistency (some support ACID) |
| Query Language | SQL | API-specific or query languages (e.g., MongoDB) |
| Best For | Complex queries, structured data | Unstructured or semi-structured data |
| Examples | MySQL, PostgreSQL, Oracle | MongoDB, Cassandra, Redis, Neo4j |