# Atomicity

> A design rule that the steps of a state change either all take effect or none do.

Record: `architecture:atomicity`
Kind: principle
Layer: [Atomic Boundary](https://banes-lab.com/records/layer/atomic-boundary.md)
Severity: mandatory
Scope: transaction, operation, workflow
Canonical: https://banes-lab.com/ontology#architecture-atomicity

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Idempotency](https://banes-lab.com/records/architecture/idempotency.md) and before [ACID](https://banes-lab.com/records/architecture/acid.md).

## Repair

- Refactored by: Add Transaction, Add Saga/Compensation
- Detected by: multi-step writes without transaction/compensation
- Violated by: partial updates after failure
- Measured by: partial failure rate
- Enforced by: transaction tests

## Requires

- [Transaction Boundary](https://banes-lab.com/records/architecture/transaction-boundary.md)

## Reinforces

- [Consistency](https://banes-lab.com/records/architecture/consistency.md)
- [Correctness](https://banes-lab.com/records/architecture/correctness.md)

## Enables

- [All-or-Nothing State Change](https://banes-lab.com/records/lexicon/all-or-nothing-state-change.md)

## Conflicts with

- [Partial Commit](https://banes-lab.com/records/lexicon/partial-commit.md)

## In tension with

- [Distributed Scalability](https://banes-lab.com/records/lexicon/distributed-scalability.md)

## Tensions

- [Atomicity / Distributed Scalability](https://banes-lab.com/records/tension/atomicity-distributed-scalability.md)

## Contracts

- [Atomic Boundary](https://banes-lab.com/records/algorithms/atomic-boundary.md)

## Severity

- [mandatory](https://banes-lab.com/records/vocabulary/severity-mandatory.md)

## Category

- [Transactions / State / Concurrency](https://banes-lab.com/records/architecture-category/transactions-state-concurrency.md)

## Required by

- [ACID](https://banes-lab.com/records/architecture/acid.md)

## Reinforced by

- [Unit of Work Pattern](https://banes-lab.com/records/architecture/unit-of-work-pattern.md)

## Linked from

- [Correctness / Determinism / Verification](https://banes-lab.com/ontology/principles/architecture-category-correctness-determinism-verification.md)
- [Transactions / State / Concurrency](https://banes-lab.com/ontology/principles/architecture-category-transactions-state-concurrency.md)
- [Transactions / State / Concurrency](https://banes-lab.com/ontology/lexicon/lexicon-category-transactions-state-concurrency.md)
- [Architectural Clusters](https://banes-lab.com/ontology/algorithms/algorithms-domain-architectural-clusters.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)
- [The resolutions](https://banes-lab.com/ontology/schema/the-resolutions.md)
