Junior
What is the difference between relational and non-relational databases?
sobes.tech AI
Answer from AI
Relational databases store data in tables with rows and columns, linked by keys. They have a fixed schema. Suitable for structured data with strong relationships.
Non-relational (NoSQL) databases use various data storage models (document, key-value, graph). They have a flexible/dynamic schema. Suitable for unstructured data, scaling, and high availability.
Key differences in the table:
| Characteristic | Relational Databases | Non-relational Databases (NoSQL) |
|---|---|---|
| Data Model | Tables, rows, columns | Documents, key-value, graphs |
| Schema | Fixed, strict | Dynamic, flexible |
| Relationships | Defined by foreign keys | Weak or absent |
| Scaling | Vertical (upwards) | Horizontal (outward) |
| Query Language | SQL | Various APIs/query languages |
| Examples | PostgreSQL, MySQL | MongoDB, Redis, Cassandra |