Atomic Delivery

An all-or-nothing execution model where a transaction must complete fully, or fail completely with no partial state changes.

The term 'atomic' originates from the ancient Greek word 'atomos', meaning indivisible. In computing, it means the operation cannot be split into smaller observable parts.

Without atomic delivery, distributed systems would be highly susceptible to 'race conditions' and orphaned data. For example, in a banking system, transferring $100 from Account A to Account B requires two operations: debiting A and crediting B. If the system crashes after debiting A but before crediting B, the $100 is lost. Atomic delivery guarantees that either both accounts are updated simultaneously, or neither is.

        graph LR
  Center["Atomic Delivery"]:::main
  Pre_distributed_systems["distributed-systems"]:::pre --> Center
  click Pre_distributed_systems "/terms/distributed-systems"
  Pre_networking["networking"]:::pre --> Center
  click Pre_networking "/terms/networking"
  Pre_consensus_mechanism["consensus-mechanism"]:::pre --> Center
  click Pre_consensus_mechanism "/terms/consensus-mechanism"
  Rel_atomic_swap["atomic-swap"]:::related -.-> Center
  click Rel_atomic_swap "/terms/atomic-swap"
  classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
  classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
  classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
  classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
  linkStyle default stroke:#4b5563,stroke-width:2px;

      

🧒 Explain Like I'm 5

It's like buying a toy at a shop. You only give the money if you actually get the toy in your hand. If the shopkeeper doesn't have the toy, you keep your money. Both things happen at the exact same time, or they don't happen at all. You never end up with no toy and no money.

🤓 Expert Deep Dive

Database Systems
In relational databases, atomicity is typically implemented via write-ahead logging (WAL) or shadow paging. If a process crashes mid-transaction, the recovery manager uses the log to undo any uncommitted modifications upon reboot.

Blockchain & Smart Contracts
In distributed ledger technology, atomic delivery is the foundation of decentralized finance (DeFi). The Ethereum Virtual Machine (EVM) natively enforces atomicity: if a smart contract encounters an out of gas error or a revert() statement during execution, all prior state changes within that transaction are discarded.

Cross-Chain Atomic Swaps
When dealing with disparate ledgers (e.g., trading Bitcoin for Litecoin without an exchange), atomic delivery is achieved using Hashed Timelock Contracts (HTLCs). HTLCs use cryptographic hash functions and time constraints to ensure both parties acknowledge receipt of funds within a specific window; otherwise, the funds are automatically refunded to their original owners.

❓ Frequently Asked Questions

What does the 'A' in ACID stand for?

The 'A' in the ACID database model stands for Atomicity, which is the exact same concept as atomic delivery: transactions are indivisible and all-or-nothing.

What is an Atomic Swap in crypto?

An atomic swap allows two people to trade different cryptocurrencies (like Bitcoin for Ethereum) directly from their wallets without using a centralized exchange. It uses atomic delivery to ensure neither party can run away with the funds.

What happens if an atomic transaction fails halfway?

The system initiates a 'rollback'. It undoes any changes made during the partial execution, returning the system to the exact state it was in before the transaction started.

🔗 Related Terms

📚 Sources