Operations on the database are grouped into transactions. This helps ensure [[ACID]] compliance. A transaction is also known as a logical unit of work (LUW). Either all the actions in a transaction are committed or none are committed.
Transactions are **interleaved** meaning that the operating system quickly switches CPU services among tasks so some portion of each task is carried out in a given interval, but the transactions appear concurrent. In other words, multiple transactions can execute at the same time without compromising data integrity. This is called **concurrency**.
Concurrency entails challenges including
- **Lost update**: one user's changes overlay or interfere with another's
- **Inconsistent reads**: two users can read the same thing and get different results. Reading from the buffer cache can result in an inconsistent read known as a **dirty read**.
- **Deadlocks**: also known as "deadly embrace", occurs when two transactions rely on resources locked by each other.
[[serializable transactions]]
[[locking]]
[[transaction logs]]
[[commit]]
[[rollback]]