Professional Documents
Culture Documents
36% COMPLETE
07:17
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.
https://3mtt.altschoolafrica.com/topics/relational-databases-postgres-3/ 3/3