Composite key vs Single key append stringsWhat is the difference between create an index with compositeKey and a normal index?Getting world state by valueHow to query table with partial key valuesPrivacy on Hyperledger Fabric v1.0Composite Key formation for a date range in Hyperledger Fabric V1.0Attempt to achieve high throughput in Hyperledger Fabric networkSingle organization Hyperledger fabric n/wFree Text search on Hyperledger Fabric CouchDB Data with Elastic SearchWhat is the difference between create an index with compositeKey and a normal index?
Was the Ford Model T black because of the speed black paint dries?
What is this welding tool I found in my attic?
If your plane is out-of-control, why does military training instruct releasing the joystick to neutralize controls?
Is Arc Length always irrational between two rational points?
Storming Area 51
What's the maximum time an interrupt service routine can take to execute on atmega328p?
If the railway suggests a 5-min connection window for changing trains in the Netherlands, does that mean it's definitely doable?
Is Trump personally blocking people on Twitter?
Why was hardware diversification an asset for the IBM PC ecosystem?
Does the Dispel Magic spell work on the Mirror Image spell?
What are some examples of special things about Russian?
Managing and organizing the massively increased number of classes after switching to SOLID?
how to convert unix epoch microseconds into Java time stamp
Drawing color tiles using Tikz
What do the horizontal lines in a P-V phase diagram mean?
Matchmaker, Matchmaker, make me a match
How do I take a fraction to a negative power?
Why are characters missing from rendered text when using XeLaTex with utf8 and an installed font?
PIC12F675 GP4 doesn't work
Robbers: The Hidden OEIS Substring
Cops: The Hidden OEIS Substring
Does throwing a penny at a train stop the train?
Flatten array with OPENJSON: OPENJSON on a value that may not be an array? [ [1] ], vs [1]
Why isn't pressure filtration popular compared to vacuum filtration?
Composite key vs Single key append strings
What is the difference between create an index with compositeKey and a normal index?Getting world state by valueHow to query table with partial key valuesPrivacy on Hyperledger Fabric v1.0Composite Key formation for a date range in Hyperledger Fabric V1.0Attempt to achieve high throughput in Hyperledger Fabric networkSingle organization Hyperledger fabric n/wFree Text search on Hyperledger Fabric CouchDB Data with Elastic SearchWhat is the difference between create an index with compositeKey and a normal index?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Watching many examples in Hyperledger Fabric I found two ways to achieved a key:
Let's suposse we have two fields visa and type of visa.
Visa: "1212323"
Type of Visa: "Student Visa"
So we can create a key neither:
- Using CompositeKey function provide by stub
key, err := stub.CreateCompositeKey(indexName,[]stringvisa, typeVisa)
stub.PutState(key, value)
- Concatenating the two fields
stub.PutState(visa+typeVisa, value)
What is the difference between those two approaches?
What is the best performance?
hyperledger-fabric hyperledger blockchain
add a comment |
Watching many examples in Hyperledger Fabric I found two ways to achieved a key:
Let's suposse we have two fields visa and type of visa.
Visa: "1212323"
Type of Visa: "Student Visa"
So we can create a key neither:
- Using CompositeKey function provide by stub
key, err := stub.CreateCompositeKey(indexName,[]stringvisa, typeVisa)
stub.PutState(key, value)
- Concatenating the two fields
stub.PutState(visa+typeVisa, value)
What is the difference between those two approaches?
What is the best performance?
hyperledger-fabric hyperledger blockchain
add a comment |
Watching many examples in Hyperledger Fabric I found two ways to achieved a key:
Let's suposse we have two fields visa and type of visa.
Visa: "1212323"
Type of Visa: "Student Visa"
So we can create a key neither:
- Using CompositeKey function provide by stub
key, err := stub.CreateCompositeKey(indexName,[]stringvisa, typeVisa)
stub.PutState(key, value)
- Concatenating the two fields
stub.PutState(visa+typeVisa, value)
What is the difference between those two approaches?
What is the best performance?
hyperledger-fabric hyperledger blockchain
Watching many examples in Hyperledger Fabric I found two ways to achieved a key:
Let's suposse we have two fields visa and type of visa.
Visa: "1212323"
Type of Visa: "Student Visa"
So we can create a key neither:
- Using CompositeKey function provide by stub
key, err := stub.CreateCompositeKey(indexName,[]stringvisa, typeVisa)
stub.PutState(key, value)
- Concatenating the two fields
stub.PutState(visa+typeVisa, value)
What is the difference between those two approaches?
What is the best performance?
hyperledger-fabric hyperledger blockchain
hyperledger-fabric hyperledger blockchain
asked Mar 26 at 15:34
Julian SolarteJulian Solarte
15012 bronze badges
15012 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55360962%2fcomposite-key-vs-single-key-append-strings%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
add a comment |
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.
add a comment |
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.
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.
answered Mar 27 at 10:20
R ThatcherR Thatcher
4,8701 gold badge3 silver badges14 bronze badges
4,8701 gold badge3 silver badges14 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55360962%2fcomposite-key-vs-single-key-append-strings%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown