You are on page 1of 3

3/8/24, 3:10 PM Relational Databases (Postgres) – 3mtt – AltSchool Africa

36% COMPLETE

 Previous Topic Mark Complete 

Relational Databases (Postgres)


3MTT Data Analysis – Intermediate Module > Relational Database Management Syst… IN PROGRESS

Lesson 7 - Relational Databases (Postgres)


AltSchool Africa

07:17

Relational Databases (Postgres)


Relational databases (RDB) organize data modeled in rows and columns in a
series of tables to make processing and data querying efficient.
An RDB has the ability to establish links—or relationships–between information by
joining tables, which makes it easy to understand and gain insights about the
relationship between various data points.
id customer_name
1 James Joseph
2 Timothy Brown

id customer_id order_item order_date


https://3mtt.altschoolafrica.com/topics/relational-databases-postgres-3/ 1/3
3/8/24, 3:10 PM Relational Databases (Postgres) – 3mtt – AltSchool Africa

4 1 Shoe 2022-04-12
5 2 Trouser 2022-05-24
Some of the advantages of RDBs are:
It’s flexible (i.e. it’s easy to add, update, or delete data without changing the DB
structure),
It’s ACID (display on screen) compliant
Atomicity: A database transaction happens all at once or not at all.
Consistency: The database stays consistent before and after each
transaction
Isolation: Multiple database transactions can occur independently without
interference.
Durability: The changes made by a successful transaction happens even if
a system failure happens.
Some of the advantages of RDBs are:
It’s Collaboration-friendly (this means there can be simultaneous actions
happening on the database by multiple actors due to transaction lock)
Built-in security (as a result of role-based access control used to ensure users
have the appropriate access)
Normalization (reduces data redundancy and improves data integrity)
I’ve mentioned the word “Transaction” for quite a bit, what does this even mean?
So think of a transaction between two parties, the idea often is that once an
agreement is made, the process is not concluded until everything stated in that
agreement is finalized.
Similarly, in a database transaction, the SQL statement is the agreement being
made with the database, where you as the data engineer is saying, these are the
actions I would like to perform. Once the database starts to execute your SQL
command, no changes are effected, until the process is completed. This means
that, if there’s a network failure, for example, when trying to connect with the
database, your requested change will not be executed successfully. This is
usually described as “All or nothing”.
Now, what does a transaction lock mean? It means that while a transaction is
being executed, the database locks the rows or tables where the transaction is

https://3mtt.altschoolafrica.com/topics/relational-databases-postgres-3/ 2/3
3/8/24, 3:10 PM Relational Databases (Postgres) – 3mtt – AltSchool Africa

being executed, such that no other transaction can happen on that resource at
the same time.
This concept is important to understand because, one of things that can cause
potential issues in your database or data warehouse is long-running SQL
commands. Basically, SQL commands that take a very long time to execute.
Often times, the consequence of this is that, since that resource is locked
through out the period of the transaction, someone else trying to execute
another transaction at the same time, this may fail, and result in unexpected
issues.

 Previous Topic Back to Lesson Mark Complete 

https://3mtt.altschoolafrica.com/topics/relational-databases-postgres-3/ 3/3

You might also like