Database Transaction
A database transaction is a sequence of operations performed as a single logical unit of work. It ensures that either all operations are completed successfully or none at all, maintaining the integrity of the database. This concept is crucial in systems where data consistency is essential, such as in banking or e-commerce.
Transactions follow the ACID properties: Atomicity, Consistency, Isolation, and Durability. Atomicity guarantees that all parts of the transaction are completed; if one part fails, the entire transaction is rolled back. Consistency ensures that the database remains in a valid state, while Isolation allows transactions to operate independently. Finally, Durability ensures that once a transaction is committed, it remains so, even in the event of a system failure.