DatabaseIF
Core Concept

ACID Properties

The bedrock of transactional integrity. Without this, your financial application is a random number generator.

A

Atomicity

"All or nothing." A transaction often involves multiple operations (e.g., deducting balance from Account A, adding to Account B). Atomicity guarantees that if any part of the transaction fails, the entire transaction is rolled back. You never end up in a state where money was deducted but never added.

C

Consistency (Database)

Not to be confused with Consistency in the CAP theorem. In ACID, Consistency means a transaction can only bring the database from one valid state to another valid state, maintaining all defined rules, constraints, cascades, and triggers. If a transaction attempts to write data that violates a constraint (like a foreign key or a unique index), it is rolled back.

I

Isolation

Determines how transaction integrity is visible to other users and systems. When multiple users are reading/writing concurrently, isolation ensures their transactions don't interfere.

Levels include: Read Uncommitted, Read Committed, Repeatable Read, and Serializable (the strictest, but slowest).
D

Durability

Once a transaction has been committed, it will remain so, even in the event of a power loss, crash, or error. This usually means the transaction is recorded in non-volatile memory (written to a write-ahead log on disk) before the database returns a "success" response to the client.