Types of Databases
Understand the key differences between relational databases and NoSQL systems, including ACID guarantees and scaling approaches. Evaluate common NoSQL models, document, graph, and key-value, and their trade-offs. Choose an appropriate database architecture based on the constraints of the system design problem.
Databases are commonly grouped into two categories: relational and NoSQL (non-relational).
Relational databases
Relational databases enforce a predefined schema before storing data. Data is organized into relations (tables) composed of tuples (rows) and attributes (columns). Each tuple has a unique key. Because data is structured, a tuple in one table can link to a tuple in another using a foreign key.
Structured Query Language (SQL) is used to manage the database, handling data insertion, deletion, and retrieval.
Relational databases are dominant due to their simplicity, robustness, flexibility, and
However, ACID guarantees can be overkill for some use cases. If an application can tolerate specific anomalies, a custom solution might offer higher performance, though it adds implementation complexity.
The ACID offers the following properties:
Atomicity: Transactions are atomic units. Either all statements in a transaction execute successfully, or none do. Failed transactions are aborted and rolled back.
Consistency: The database remains in a consistent state before and after every transaction. It enforces rules to ensure data validity.
Isolation: Concurrent transactions do not affect each other. The final state of the database is the same as if the transactions were executed sequentially.
Durability: Once a transaction is committed, it survives permanently, even in the event of a system failure.
Popular database management systems (DBMS) for relational schemas include:
MySQL ...