Intro
A database is a structured collection of data that is organized and stored in a way that allows for efficient retrieval, management, and manipulation of information. Databases are designed to store and manage large volumes of data in a structured and organized manner. They are a fundamental component of modern information systems and play a crucial role in various applications and industries.
ACID
ACID is an acronym that stands for Atomicity, Consistency, Isolation, and Durability. It is a set of properties that guarantee reliable processing of database transactions. These properties ensure that database transactions are processed reliably even in the face of system failures.
Transactions
In the context of databases, a transaction is a unit of work that represents a sequence of one or more database operations (such as queries, inserts, updates, or deletes) that need to be executed as a single, indivisible unit. The concept of transactions is essential in database management systems to ensure data consistency, integrity, and reliability, particularly in multi-user and concurrent database environments.
Lifecycle of Transactions
The transactions would involve below list of steps
- BEGIN Transaction:-- Start the trasaction from here
- COMMIT Transaction:-- When all queries part of transaction success Commit them to make them permenent.
- ROLLBACK Transaction:-- Revers all operations that were done when failed.
- END Transaction:-- End the transaction here.