1. Transactions


A transaction is the execution of a sequence of one or more operations (e.g., SQL queries) on a database to perform some higher-level function.

It is the basic unit of change in a DBMS → Partial transactions are not allowed!

The DBMS is only concerned about what data is read/written from/to the database.

⇒ Changes to the "outside world" are beyond the scope of the DBMS.

<aside> 💡 Definitions

Database → A fixed set of named data objects (e.g., A, B, C, …)

Transaction → A sequence of read and write operations ( R(A), W(B), …)

A txn starts with the BEGIN command and stops with either COMMIT or ABORT

</aside>

ACID

2. Atomicity


Approach #1: Logging

Like the black box in airplanes. Used for both audit trail and efficiency reasons

Approach #2: Shadow Paging

Super slow and problematic