AWS Quantum Ledger Database (QLDB) With Node.js and Ionic

What is QLDB?

This means QLDB is centralized ledger database where data is always inserted, never updated, keeping history of all the changes made to the database. Well, you can achieve similar functionality just by using your favorite relational Database such as MySQL or Oracle. But what you can’t guarantee is the immutability. With administrative privilege of database, someone can delete the audit log which is not possible with QLDB ( at least at the time of writing this article). Moreover each transaction is cryptographically verifiable more like blockchain transactions.

QLDB vs Blockchain

Tutorial & Demo

I have created one QLDB Ledger named DealLedger and one table named Deal. Loaded 3 records into Deal table. I saved all the query and data in samepledata.txt

Backend API is written ExpressJS and deployed to Lambda so that one API Gateway can serve multiple REST endpoints.

Okay, enough of AWS Serverless, let me show you the meat :) Below is the IONIC app where I am going to change the status of deal id 108570 to Scanned.

Let’s look at the data from Deal table below. QLDB maintains a current state of the data same as World State in Hyperledger Fabric.

Let’s click on the “History” button which retrieves all the changes made to the deal 108570. We should see 2 entries, one with status “saved” and other with status “scanned” as expected. Also notice Doc ID remains same for the deal id but Tnx ID and Block ID change whenever any modification made to the data.

The most important and attractive feature of QLDB is cryptographic verification which is basically re-calculating hashes ( SHA-256) to ensure integrity of data modification. Using cryptography, you can easily verify that there have been no unintended modifications to your application’s data.

Thanks for reading and keep learning !

--

--

https://iammithun.link

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store