0

The problem is that whenever my Api is fetching any data from Qldb the Qldb ledger gets updated and it adds that data to Qldb stream but what I want is that whenever the API performs an insert, update, or delete is performed only then my data must enter in qldb streams.

1 Answers1

1

In Amazon QLDB, the journal is the immutable transactional log that stores the complete and verifiable history of all the changes to your data (doc).

The transactionInfo field of a journal block will contain a complete list of PartiQL statements executed and committed by your QLDB ledger (doc). This means the transactionInfo field will contain SELECT statements, as well as INSERT, UPDATE, and DELETE statements. For a full list of PartiQL commands which may comprise statements added to this field, please see the PartiQL commands doc.

All queries are transactional, meaning that even read-only queries create new blocks in the journal and those blocks will appear in the stream and in journal exports. QLDB does not currently offer a way of filtering what information is sent into the stream. However, it is possible to read data from a downstream, purpose-built database without creating new journal blocks.

For QLDB Streams, there are three types of data records written to Kinesis: CONTROL, BLOCK_SUMMARY, and REVISION_DETAILS (doc). Read-only queries will not generate REVISION_DETAILS records in the stream, so all REVISION_DETAILS records represent INSERTs, UPDATEs, and DELETEs. Read-only queries will generate BLOCK_SUMMARY records in the stream, but those stream records will not contain any document revisions and are easy to filter out in your stream consumer. This is the most straightforward way to ensure that your consumer stream will only receive updates when your ledger is updated.

Matthew Ma
  • 11
  • 1