Amazon Quantum Ledger Database (Amazon QLDB)
Developer Guide

Amazon QLDB Concurrency Model

Amazon QLDB is intended to address the needs of high-performance online transaction processing (OLTP) workloads. QLDB supports SQL-like query capabilities, and delivers full ACID transactions. In addition, QLDB data items are documents, delivering schema flexibility and intuitive data modeling. With a journal at the core, QLDB makes it easy to access the complete and verifiable history of all changes to your data, and to stream coherent transactions to other data services as needed.

Optimistic Concurrency Control

In QLDB, concurrency control is implemented using optimistic concurrency control (OCC). OCC operates on the principle that multiple transactions can frequently complete without interfering with each other.

When transactions are running, they access data resources without acquiring locks on those resources. Before committing, each transaction performs a validation check to ensure that no other committed transaction has modified the data it has read. If this check reveals conflicting modifications, then the committing transaction is rejected; however, the transaction can be restarted. The application software is responsible for ensuring that the transaction is restarted.

When a transaction writes to QLDB, the validation checks of the OCC model are implemented by QLDB itself. When a transaction can't be written to the journal due to a failure in the verification phase of OCC, the QLDB driver returns an OCC conflict exception to the application layer. The application software can then restart transactions that were rejected.

For more information about how to detect and handle OCC conflict exceptions, see Handling Transaction Exceptions.