Relational Database (RDBMS, SQL)#
A structure that organizes keys and values into tables
Characteristics of relational databases
- Model the data based on the data the service will handle.
- Data classification, sorting, and search are fast.
- Data integrity**(maintaining valid data or ensuring that data is accurate)** is guaranteed
Advantages of relational databases
- Following defined rules guarantees data integrity
- Because each piece of data is stored without duplication, data retrieval is more efficient.
Disadvantages of relational databases
- Difficult to modify.
- Complex queries arise
- Vertical scaling is possible
Use cases for relational databases
- Applications that use JOIN and whose data changes frequently
- When the structure is not expected to change
- When a clear schema is important to users and data
Non-Relational Database (NOSQL)#
There is no tabular structure for keys and values. (Randomness)
Characteristics of non-relational databases
- Data with different structures can be added to the same collection.
- Related data is stored together in one place rather than being split across multiple tables.
- Create documents containing everything needed, without linking tables
Advantages of non-relational databases
- Because there is no schema (data structure), data is easy to modify and manage.
- Data is stored in the format required by the application.
- Both vertical and horizontal scaling are possible, enabling data to be read and written.
Disadvantages of non-relational databases
- When duplicated data is changed, it must be updated in multiple storage locations.
- When performing an update (UPDATE) operation, it must be carried out everywhere.
Use cases for non-relational databases
- Use when the exact data is unknown (when it may change or expand)
- When there is a large amount of data
- When reads are frequent and data is not changed often