ACID - Atomicity

ACID - Atomicity


Atomicity is the core ACID property ensuring that any set of data modifications is treated as a single, indivisible unit. This principle dictates an "all or nothing" result: a transaction must either complete entirely, committing all changes as a single ordered atomic commit in the transaction log, or if a failure occurs during the process, the entire transaction must be rolled back to its original state.



Failure Prevention: It ensures data integrity and consistency by guaranteeing that if a process fails mid-operation (e.g., during a data modification), partially completed changes are avoided by rolling back the transaction.

Mechanism (Delta Lake): Achieving atomicity for complex operations (like deleting rows) means the multiple resulting actions (removing old files, adding new files containing unaffected rows) are wrapped into a single transaction log entry that is committed indivisibly.

Streaming Reliability: Atomicity supports idempotent writes for streaming applications through the use of transaction identifiers (txnAppId and txnVersion), which allows the system to detect and ignore duplicate write attempts, ensuring integrity across multiple destinations.





Atomicity | Ensures a transaction is treated as a single, indivisible unit; it either completes entirely or fails entirely. | Operations (like update/delete) are wrapped in a single ordered atomic commit in the transaction log file.

If a process fails during a data modification, the transaction must be rolled back to its original state, thereby ensuring the data remains consistent and avoiding partially completed changes.



Source: https://delta.io/pdfs/dldg_databricks.pdfPage: 11, 22, 19 • Key: leeDeltaLakeDefinitive