Chapter 10 · Transaction Boundaries and Consistency by Design

ACID Properties as Design Constraints

Understand ACID as a set of design constraints and connect atomicity, consistency, isolation, and durability to concrete database operations.

Beginner65–90 minutesACID + failure reasoningLast reviewed: August 2026

Learning outcomes

ACID summarizes four essential transaction properties: Atomicity, Consistency, Isolation, and Durability. These are not marketing labels; each corresponds to specific failure modes that the data model and DBMS must address.

01

Explain each ACID property in practical terms.

02

Distinguish database consistency from business correctness.

03

Connect isolation to concurrency anomalies.

04

Connect durability to commit, logging, and recovery expectations.

Atomicity

Atomicity means a transaction's database changes are all-or-nothing. If a failure occurs before commit, partial changes are rolled back.

sql · example
BEGIN;UPDATE inventory ...;INSERT part_usage ...;COMMIT;

If the insert fails, the inventory decrement should not remain committed.

Atomicity is not distributed magic

A database transaction cannot automatically roll back an email already sent or an HTTP request already accepted by another service. Cross-system workflows require patterns such as outbox, idempotency, sagas, or compensating actions.

Consistency

Consistency means a valid transaction takes the database from one state satisfying its enforced invariants to another valid state.

Examples:

  • foreign keys remain valid;
  • quantities remain positive where required;
  • unique keys remain unique;
  • application-managed invariants remain true.

Consistency is shared responsibility

The DBMS can enforce declared constraints, but it does not know every business rule automatically. If the rule “a closed WorkOrder has no active Assignment” is not encoded anywhere, ACID does not invent it.

Important

ACID consistency means preservation of defined invariants—not proof that your domain model is correct.

Isolation

Isolation controls how concurrent transactions observe and interfere with one another. Ideally, concurrent execution behaves like some serial ordering, but lower isolation levels permit certain anomalies for performance and concurrency.

Durability

Durability means that after the DBMS reports a successful commit, the transaction's effects survive expected failures according to the database's configured durability guarantees.

ACID through one WorkshopHub operation

For RecordPartUsage:

PropertyMeaning
AtomicityInventory decrement and PartUsage insert commit together.
ConsistencyStock and usage rules remain valid.
IsolationTwo concurrent consumers cannot both overspend the same stock.
DurabilityAfter commit succeeds, the recorded usage survives recovery.

Failure before commit

If the process crashes after updating two rows but before commit, atomicity requires rollback during recovery.

Failure after commit acknowledgement

If the process crashes after commit completes, durability requires the committed state to survive within the DBMS's guarantee model.

Commit uncertainty

A client can lose its network connection just after sending COMMIT. It may not know whether commit succeeded. This is why application operations often need idempotency keys: retries must be safe even when the result of the first attempt is uncertain.

ACID does not mean “no concurrency”

Isolation permits concurrency while controlling anomalies. Database engines use locks, MVCC, validation, serialization checks, or combinations of these techniques.

Durability versus performance

Some systems allow configuration that trades strict durability for latency or throughput. Such choices are operational decisions with data-loss implications and should not be accidental.

Database versus application state

A transaction can atomically persist database rows, but in-memory caches or files may lag. Treat the database commit as one consistency boundary and design downstream projections carefully.

ACID and constraints

Strong declarative constraints reduce how much business consistency must be implemented manually:

sql · example
PRIMARY KEYUNIQUEFOREIGN KEYCHECKNOT NULL

ACID and long workflows

Long business processes such as repair approval, shipping, or payment settlement are usually composed of many short ACID transactions connected by durable state transitions.

Practice: map the failure mode

Which ACID property?

  1. Half an order is written after a crash.
  2. Two concurrent transactions both reserve the same last item.
  3. A committed row disappears after restart.
  4. A transaction stores an invalid foreign-key reference.
Review answer

1: Atomicity. 2: Isolation/concurrency control. 3: Durability. 4: Consistency/integrity enforcement.

Summary and next lesson

ACID connects failure handling to schema design. Atomicity protects units of work, consistency preserves declared invariants, isolation governs concurrent interaction, and durability protects committed state. The next lesson focuses on isolation in detail and shows how concurrency can break invariants even when every individual transaction looks correct.

References

  • Jim Gray and Andreas Reuter, Transaction Processing: Concepts and Techniques.
  • Martin Kleppmann, Designing Data-Intensive Applications.
  • PostgreSQL documentation on transaction isolation.

Keep knowledge open

Help the academy stay free and grow.

If these tutorials save you time, a small donation supports new lessons, technical review, diagrams, examples, and long-term maintenance.

ETHEthereum / ERC-20 only
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0

Send only assets compatible with the Ethereum/ERC-20 network. Do not send TRC-20/TRON assets.