Submitting Querying/Reads to Blockchain


White, Spencer (S.)
 

Hello,

Is it an anti-pattern or bad practice to submit transactions to the orderer that are just queries/reads of the blockchain? I know in the documentation there is this line: If the chaincode is only querying the ledger, the application would only inspect the query response and would typically not submit the transaction to the ordering service.

We were considering submitting queries/reads so we could track who is looking at what on the blockchain, but this could be left to middleware logging instead I suppose. Any thoughts are appreciated.

Sincerely,

Spencer


David Enyeart
 

It would not be a reliable means to track who queried, as the client could simply choose not to submit the query for ordering.
It would also greatly inflate the size of your chain.
However, if you have a use case where it is in the client's interest to prove that they knew some fact at a certain point in time, then it may make sense to submit the query for ordering.


Dave Enyeart

"White, Spencer (S.)" ---03/27/2020 07:54:09 AM---Hello, Is it an anti-pattern or bad practice to submit transactions to the orderer that are just que

From: "White, Spencer (S.)" <swhit210@...>
To: "fabric@..." <fabric@...>
Date: 03/27/2020 07:54 AM
Subject: [EXTERNAL] [Hyperledger Fabric] Submitting Querying/Reads to Blockchain
Sent by: fabric@...





Hello,

Is it an anti-pattern or bad practice to submit transactions to the orderer that are just queries/reads of the blockchain? I know in the documentation there is this line: If the chaincode is only querying the ledger, the application would only inspect the query response and would typically not submit the transaction to the ordering service.

We were considering submitting queries/reads so we could track who is looking at what on the blockchain, but this could be left to middleware logging instead I suppose. Any thoughts are appreciated.

Sincerely,

Spencer