CLOUD CONCEPT

ACID Transactions

ACID transactions group data operations into a reliable unit of work with atomicity, consistency, isolation, and durability guarantees.

Cloud Concepts Hub →

What is ACID Transactions

ACID properties help applications update shared data correctly despite concurrent requests, processing errors, and infrastructure failures. They apply to relational databases, some NoSQL operations, and transactional lakehouse tables, but their scope and isolation guarantees depend on the implementation.

A transaction is a logical unit of work that reads or changes data and either commits or aborts. ACID describes four properties of that unit: atomicity, consistency, isolation, and durability. These properties are useful whenever partially completed or conflicting changes would produce incorrect results, such as charging an account, reserving inventory, or publishing an ingestion batch.

Atomicity means that a transaction's changes take effect together or not at all. For an account transfer, the debit and credit must commit together; a failure between them must not leave only the debit applied. Consistency means that a successful transaction preserves defined data invariants, such as unique order identifiers, valid foreign keys, or a balance rule. The database enforces declared constraints, but application logic must still express business rules correctly. ACID consistency does not mean that every replica immediately returns the latest value.

Isolation controls how concurrent transactions interact. Serializable isolation aims to produce results equivalent to some serial execution, while weaker isolation levels allow more concurrency but can permit anomalies. Multiversion concurrency control lets readers access appropriate versions without blocking every writer, although conflicting writes can still wait or fail. Durability means that acknowledged commits survive failures within the system's documented guarantees, typically through transaction logs and persistent or replicated storage. Backups remain necessary for accidental deletion, corruption, and disaster recovery.

For a relational application, begin a transaction, perform the related statements, and commit only when the entire operation succeeds. Keep transactions short and avoid waiting for external API calls while holding locks. MySQL with InnoDB and PostgreSQL both support ACID transactions; ACID support alone is not a reason to select one over the other. Their defaults differ: InnoDB normally uses repeatable read, while PostgreSQL normally uses read committed. Evaluate isolation behavior, indexing, query plans, extensions, connection limits, and workload performance rather than assuming identical behavior from the same SQL syntax.

Stateful and stateless processing describe whether work retains information across operations, not whether it supports ACID. A stateful ingestion processor might maintain running totals, deduplication records, or window state. A stateless processor transforms each record independently. A stateless application worker can still execute a database transaction, and a stateful streaming job is not automatically transactional. Checkpoint recovery, source offsets, sink commits, and idempotent writes must be coordinated to prevent duplicate or missing results. ACID at the destination alone does not establish end-to-end exactly-once processing.

In a data lake, Apache Iceberg supplies transactional table semantics through snapshots, metadata, and a compatible catalog commit mechanism. Writers prepare data files and metadata, then publish a new table state through an atomic metadata update. Readers use a committed snapshot rather than seeing a partially published collection of files. Concurrent writers use optimistic concurrency control and validation; conflicts may require retries or recomputation. These guarantees generally apply to an individual table commit, not automatically to a business operation spanning multiple tables. Object storage consistency by itself does not make a directory of Parquet files an ACID table.

Transaction boundaries are an architectural decision. A database commit does not normally include a message sent to an external queue or a payment-provider request. A transactional outbox can record both business changes and an event in one database transaction, followed by asynchronous publication with deduplication. Across independent services, coordinated transactions or compensating workflows require additional design. Stronger isolation, distributed coordination, logging, and replication can increase latency, contention, and cost. Use the smallest transaction boundary that protects the required invariants, and implement bounded retries and idempotency for deadlocks, serialization failures, and uncertain commit outcomes.

Key aspects of ACID Transactions

ACID protects a defined unit of work, while isolation settings, transaction boundaries, and recovery design determine its practical guarantees.

Atomicity

All changes within the transaction boundary commit together or are rolled back. Place dependent operations, such as decrementing inventory and creating a reservation, inside that same boundary.

Consistency

Successful transactions preserve declared constraints and correctly implemented business invariants. This property does not guarantee application correctness or immediate freshness on every read replica.

Isolation

Isolation determines which effects concurrent transactions can observe and which anomalies are possible. Choose an isolation level deliberately and handle conflicts or serialization failures with safe retries.

Durability

Once a commit is acknowledged, its changes persist within the configured failure guarantees. Logging and replication support durability, while backups address additional recovery requirements.

Explicit transaction scope

Guarantees apply only to participating operations and resources. A single-table lakehouse commit or database transaction does not automatically include another table, an external API, or a message broker.

Processing state and recovery

Stateful processors retain information between events; stateless processors do not require that retained processing state. Either can interact with an ACID destination, but reliable ingestion also requires coordinated checkpoints, offsets, and duplicate handling.

Cloud services for ACID Transactions

Amazon RDS and Amazon Aurora can protect operational changes with relational transactions, while Amazon DynamoDB offers transactional APIs for related item updates. For analytical ingestion, AWS Glue can write Iceberg tables and Amazon Athena can query or modify supported Iceberg tables through their transactional metadata model. These services do not share one automatic transaction boundary. Moving data between an operational database and a lakehouse requires additional coordination, such as change data capture, checkpointing, idempotent writes, and reconciliation. Select each service according to its transaction scope, concurrency behavior, and recovery requirements.

Amazon RDS image Amazon RDS

Provides managed relational database engines that support transactions, including PostgreSQL and MySQL with InnoDB. Engine behavior, isolation levels, storage engines, and durability settings remain important when designing transaction-sensitive workloads.

Open Amazon RDS →
Amazon Aurora image Amazon Aurora

Provides MySQL-compatible and PostgreSQL-compatible relational databases with ACID transactions and distributed storage. Applications must still account for engine-specific isolation behavior and potentially stale reads from reader instances.

Open Amazon Aurora →
Amazon DynamoDB image Amazon DynamoDB

Supports ACID transactions across multiple items and tables within one AWS account and Region through transactional APIs. These guarantees do not turn global-table replication into a cross-Region atomic transaction; transactional requests also consume additional capacity compared with ordinary item operations.

Open Amazon DynamoDB →
AWS Glue image AWS Glue

AWS Glue Spark jobs can read and write Apache Iceberg tables using supported integrations and configuration. The AWS Glue Data Catalog can serve as the Iceberg catalog, while Iceberg's commit protocol provides table-level transactional publication.

Open AWS Glue →
Amazon Athena image Amazon Athena

Supports transactional reads and supported data modifications on Apache Iceberg tables using the appropriate engine version and catalog configuration. Iceberg snapshots provide consistent table views, but separate statements should not be assumed to form a general-purpose multi-table transaction.

Open Amazon Athena →