ACID
The four guarantees of a database transaction: atomicity, consistency, isolation and durability.
In more detail
ACID is an acronym of those four words. Atomicity means all or nothing; consistency means every commit leaves the data satisfying its constraints; isolation means concurrent transactions do not see each other's unfinished work; durability means committed changes survive a crash or power loss.
Example
Kafka borrows the ideas: acks and replication decide durability, and Kafka transactions make a group of writes atomic.Related terms
- transaction — A group of database changes that succeed or fail together, so the data is never left half-updated.
- acks — The producer setting that decides how many brokers must confirm a record before the send counts as successful: 0, 1 or all.
- Kafka transaction — A group of writes, possibly across several partitions and topics, that Kafka makes visible all together on commit or not at all on abort.
- unit of work — A pattern that collects the changes made during one business operation and commits them together, or not at all.
- atomicity — The property that a group of changes happens completely or not at all, with no half-finished state ever visible.
- transactional outbox — Saving an event into an outbox table in the same database transaction as the business change, then having a separate worker publish it.
- isolation level — A setting that controls how much concurrent transactions can see of each other's changes and how they may interleave.
- constraint — A rule the database enforces on stored data, such as a column that must be unique or not null.
Taught in
- The Setting That Came Back — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Two Brokers Down — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Querying, Change Tracking, and Saving Data — Modern .NET Core, C# & Enterprise Microservices
- Asynchronous Event Processing: Outbox Pattern & Queues — Production Full-Stack Engineering
- Acknowledgements: What Acks Means For Durability — Apache Kafka & Event Streaming
- Transactions And Exactly Once Semantics — Apache Kafka & Event Streaming
- Dual Writes And Why They Lose Data — Apache Kafka & Event Streaming
- Transactions And ACID Properties — PostgreSQL, Indexing & Relational Data Modeling
References
- PostgreSQL tutorial: transactions
- Transactions (EF Core)
- SQLite: atomic commit
- PostgreSQL glossary: ACID