What is a database transaction?

A database transaction groups multiple database operations into a logical unit of work. Transactions commonly provide atomicity, consistency, isolation, and durability, often summarized as ACID. If a transaction fails, changes can be rolled back according to the database's transaction semantics.

Key Takeaways
  • Transactions group related database operations.
  • ACID describes important transaction properties.
  • Transactions should be used when consistency across multiple operations requires them.
Knowledge Check

What is the main purpose of a database transaction?