Amazon Quantum Ledger Database (Amazon QLDB) provides a transparent, immutable, and cryptographically verifiable transaction log owned by a central trusted authority. Amazon QLDB tracks each and every application data change and maintains a complete and verifiable history of changes over time. Ledgers are typically used to record a history of economic and financial activity in private or public organization. Using ledger-like functionality gives organizations an accurate history of their applications’ data.
- Amazon QLDB is a new class of database that eliminates the need to engage in the complex development effort of building your own ledger-like applications.
- With QLDB, your data’s change history is immutable, which cannot be altered or deleted
- Using cryptography, customers can easily verify that there have been no unintended modifications to their application’s data. Amazon QLDB uses an immutable transactional log, known as a journal, that tracks each application data change and maintains a complete and verifiable history of changes over time.
Amazon QLDB Features
Using cryptography, customers can easily verify that there have been no unintended modifications to their application’s data. Because of that the customer data in Amazon QLDB change history is immutable, and it cannot be altered or deleted.
- This secure summary, commonly known as a digest, is generated using a cryptographic hash function.
- The digest acts as a proof of customers data’s change history, allowing them to look back and verify the integrity of their data changes.
Amazon QLDB uses an immutable transactional log, known as a journal, that tracks each application data change and maintains a complete and verifiable history of changes over time.
- The journal is append-only, which means data can only be added to a journal and it cannot be overwritten or deleted. This ensures that customer stored change history cannot be deleted or modified.
- Amazon QLDB allows customers to access the entire change history of their application’s data.
QLDB is serverless, as such it automatically scales to support the demands of clients applications. In Amazon QLDB there are no servers to manage and no read or write limits to configure.
- Since QLDB is a database, it provides better performance and scale than blockchain frameworks. Amazon QLDB can easily scale up and execute 2-3x as many transactions as common blockchain frameworks.
- Blockchain frameworks are decentralized, which require peer nodes to validate a transaction before it can be stored in the ledger, impacting their performance. On the other hand, executing a transaction in Amazon QLDB is as simple as any AWS database.
Amazon QLDB enables PartiQL, which is SQL-compatible access to QLDB’s document-oriented data model that includes semi-structured and nested data while remaining independent of any particular data source.
- PartiQL helps customers to easily query, manage, and update their data using familiar SQL operators.
- Amazon QLDB provides atomicity, consistency, isolation, and durability known as ACID properties. In addition Amazon QLDB transactions have full serializability, in other word highest level of isolation.
- Amazon QLDB stores data using a document-oriented data model, which provides the flexibility to store structured and semi-structured data. Amazon QLDB’s data model also supports nested data structures, which can simplify any application.
Amazon QLDB’s familiar database capabilities make it easy to use. Amazon QLDB supports PartiQL – a new, open source, SQL-compatible query language designed to easily work with all data types and structures. With PartiQL, you can easily query, manage, and update your data with SQL operators.
- Amazon QLDB’s document-oriented data model is flexible, enabling you to easily store and process both structured and semi-structured data.
- Amazon QLDB transactions are ACID compliant and have full serializability- the highest level of isolation.
Amazon QLDB is designed for high availability, replicating multiple copies of data within an Availability Zone (AZ) as well as across 3 AZs in an AWS region, without any additional cost or setup.
- Amazon QLDB backs up your data continuously while maintaining consistent performance, allowing it to transparently recover from any instance or physical storage failures.
Amazon QLDB Cryptographic
Using both SHA-256 hash function and a Merkle tree–based model, Amazon QDLB generates a cryptographic representation known as a digest. The digest acts as a unique signature of clients data’s entire change history as of a point in time. It enables them to look back and verify the integrity of their document revisions relative to that signature.
- A digest is a cryptographic representation of your ledger’s entire journal at a point in time. A journal is append-only, and journal blocks are sequenced and hash-chained similar to blockchains.
- A Merkle tree is a tree data structure in which each leaf node represents a hash of a data block. Each non-leaf node is a hash of its child nodes. Commonly used in blockchains, a Merkle tree enables efficient verification of large datasets with an audit proof mechanism.
- A proof is the ordered list of node hashes that Amazon QLDB returns for a given digest and document revision. It consists of the hashes that are required by a Merkle tree model to chain the given leaf node hash (a revision) to the root hash (the digest).
Amazon QLDB is made to address the needs of high-performance online transaction processing (OLTP) workloads. QLDB has SQL-like query capabilities, and delivers full ACID transactions. QLDB data items are documents, which deliver 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 any data, and to stream coherent transactions to other data services as needed.
- Using optimistic concurrency control (OCC), concurrency control is implemented in Amazon QLDP. OCC operates on the principle that multiple transactions can frequently complete without interfering with each other.
- Before committing to each transaction OCC performs a validation check to ensure that no other committed transaction has modified the snapshot of data that it’s accessing. If this check reveals conflicting modifications, or the state of the data snapshot changes, the committing transaction is rejected.
- For data storage, Amazon QLDB uses an immutable transactional log known as a journal. This journal tracks every change to the data and maintains a complete and verifiable history of changes over time.
As a ledger database, Amazon QLDB differs from other document-based databases when it comes to the following key concepts. This section provides an overview of the core concepts and terminology in Amazon QLDB, including ledger structure and how a ledger manages data.
When an application needs to modify data in a document, it does so in a database transaction. Within a transaction, data is read from the ledger, updated, and committed to the journal. The journal represents a complete and immutable history of all the changes to your data.
- Amazon QLDB writes one or more chained blocks to the journal in a transaction. Each block contains entry objects that represent the document revisions that you insert, update, and delete, along with the PartiQL statements that committed them.
- When transactions are committed to the journal as blocks that contain document revision entries. Each block is hashed and chained to subsequent blocks for verification. Each block has a sequence number to specify its address within the strand.
- A strand is a partition of your ledger’s journal. Amazon QLDB currently supports journals with a single strand only.
Fundamentally, Amazon QLDB data is organized into tables of Amazon Ion documents. More precisely, tables are collections of document revisions. A document revision represents a single iteration of the document’s full dataset. Because Amazon QLDB stores the complete change history of the data, a table contains not only the latest revision of its documents, but also all prior iterations.
- Document revisions used for inserting, updating, and deleting elements of a collection.
- The history function in Amazon QLDB is a PartiQL extension that returns revisions from the system-defined view of your table. So, it includes both your data and the associated metadata in the same schema as the committed view.
- Querying the Amazon QLDB history function with a table ID as the first input parameter is also possible. This enables to query the history of dropped tables. After a table is dropped.
QLDB is intended to address the needs of high-performance online transaction processing (OLTP) workloads. A ledger provides queryable views of the customers data based on the transaction information that is committed to the journal. Similar to views in relational databases, a view in Amazon QLDB is a projection of the data in a table. Views are maintained in real time, so that they’re always available for applications to query. They can query the following views using PartiQL
- User—The latest non-deleted revision of the application-defined data only. This is the default view in Amazon QLDB.
- Committed—The latest non-deleted revision of both the data and the system-generated metadata. This is the full system-defined table that corresponds directly to the user table.
- Customers also can query the revision history of their data by using the built-in History Function. The history function returns both the data and the associated metadata in the same schema as the committed view.
There are two types of data storage in QLDB:
- Journal storage—The disk space that is used by a ledger’s journal. The journal is append-only and contains the complete, immutable, and verifiable history of all the changes to your data.
- Indexed storage—The disk space that is used by a ledger’s tables, indexes, and indexed history. Indexed storage consists of ledger data that is optimized for high-performance queries.
After your data is committed to the journal, it is materialized into the tables that you define. These tables enable faster and more efficient queries. When an application reads data, it accesses the tables and indexes that are stored in your indexed storage.
Amazon QDLB Key Terms
Indexed storage The disk space that is used by a ledger’s tables, indexes, and indexed history. Indexed storage consists of ledger data that is optimized for high-performance queries.
Entry In object that is contained in a block. Entries represent document revisions that are inserted, updated, and deleted in a transaction, along with the PartiQL statements that committed them.
- Each entry also has a hash value for verification. An entry hash consists of the full hash chain of every revision and statement within that entry combined with the hash of the previous chained entry.
Journal The hash-chained set of all blocks that are committed in your ledger. The journal is append-only and represents a complete and immutable history of all the changes to your ledger data.
journal storage The disk space that is used by a ledger’s journal.
journal strand A partition of a journal. Amazon QLDB currently supports journals with a single strand only.
Proof The ordered list of 256-bit hash values that Amazon QLDB returns for a given digest and document revision. It consists of the hashes that are required by a Merkle tree model to chain the given revision hash to the digest hash.
- A proof enables you to verify the integrity of your revisions relative to the digest. For more information, see Data Verification in Amazon QLDB.
Table An unordered collection of document revisions.
View A queryable projection of the data in a table, based on transactions committed to the journal. In a PartiQL statement, a view is denoted with a prefix qualifier (starting with _ql_) for a table name.
Block An object that is committed to the journal in a transaction. A single transaction writes one or more blocks in the journal, but a block can only be associated with one transaction. A block contains entries that represent the document revisions that were committed in the transaction along with the PartiQL statements that committed them.
- Each block also has a hash value for verification. A block hash consists of the full hash chain of every entry within that block combined with the hash of the previous chained block.
Digest A 256-bit hash value that uniquely represents your ledger’s entire history of document revisions as of a point in time. A digest hash is generated from your ledger’s full hash chain as of the latest committed block in the journal at that time.
- Amazon QLDB enables you to generate a digest as a secure output file. Then, you can use that output file to verify the integrity of your document revisions relative to that hash.
Document A set of data in Amazon Ion struct format that can be inserted, updated, and deleted in a table. A Amazon QLDB document can have structured, semi structured, nested, and schema-less data.
document revision A structure that represents a single iteration of a document’s full dataset. A revision includes both your application-defined data and Amazon QLDB-generated metadata.
- Each revision is stored in a table and is uniquely identified by a combination of the document ID and a zero-based version number.
Amazon QDLB Use Case
Big organizations such as Accenture, digital asset and health Direct use Amazon QLDP for the following purposes
- banks can use Amazon QLDB to easily store an accurate and complete record of all financial transactions.
- A ledger database can be used to record the history of each transaction, and provide details of every individual batch of the product manufactured at a facility. In case of a product recall, manufacturers can use Amazon QLDB to easily trace the history of the entire production and distribution lifecycle of a product.
- Insurance companies can use Amazon QLDB to accurately maintain the history of claims over their entire lifetime, and whenever a potential conflict arises, Amazon QLDB can also help cryptographically verify the integrity of the claims data making the application resilient against data entry errors and manipulation.
- By implementing a system-of-record application using Amazon QLDB, customers can easily maintain a trusted and complete record of the digital history of their employees, in a single place.
- With Amazon QLDB, retail companies can look back and track the full history of inventory and supply chain transactions at every logistical stage of their products