CHAPTER 1Relational Databases
Relational Databases
The most rich and powerful of the database types, with the most complex (and mathematically validated) data model. Relational databases use tables, and relationships between them (usually equating columns in different tables). They need a schema in advance to work with data. But the schema and the underlying technology have been perfected for many years. SQL is standardized, and the most sophisticated query language available.
Here is a table describing qualitatively the different aspects of relational databases:
Aspect | Range | Reasons |
---|---|---|
Performance | low-high | Depending on the query, they can be very fast or very slow |
Scalability | low | It is very difficult to scale relational databases |
Flexibility | low | Since they have a schema, many changes require modifying the schema first |
Complexity | high | They are the most powerful of all databases |
Recursivity | low | Deep recursion can kneel relational databases |
Schemas
A schema is a definition for the types stored in a database. It comprises:
- Tables: the collections of entities stored
- Columns: the attributes of the entities stored on each table, along with their types.
- Integrity Constraints: the conditions that the data must always fulfill.
The presence of a schema allows a database to optimize its performance in advance.
Joins
A join is an operation in which we ask for data coming from different tables (or collections) and the database engine has to relate entities in one table to entities in another. All of this is done through keys ("foreign keys" in relational databases and "object keys" in document databases).