Composite key vs Single key append strings

后端 未结 1 1240
北海茫月
北海茫月 2021-01-28 13:33

Watching many examples in Hyperledger Fabric, I found two ways to achieve a key:

Let\'s say we have two fields visa and type of visa.

Visa: \"12

相关标签:
1条回答
  • 2021-01-28 14:14

    By using Composite Keys you will have access to extra methods in your chaincode e.g. getStateByPartialCompositeKey so you could potentially retrieve all "Student Visa". If you make your own keys you would have to retrieve all the Visas then filter the set youself, or write queries to retrieve the data by attributes (assuming you are using JSON data in a CouchDB state database.) . So I would think the performance differential is in efficient retrieval rather than the original writing of the keys.

    There is a good doc in the Fabric docs on CouchDB as the State Database which covers this information.

    0 讨论(0)
提交回复
热议问题