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;








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:



  1. Using CompositeKey function provide by stub

key, err := stub.CreateCompositeKey(indexName,[]stringvisa, typeVisa)
stub.PutState(key, value)



  1. Concatenating the two fields

stub.PutState(visa+typeVisa, value)



What is the difference between those two approaches?
What is the best performance?










share|improve this question




























    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:



    1. Using CompositeKey function provide by stub

    key, err := stub.CreateCompositeKey(indexName,[]stringvisa, typeVisa)
    stub.PutState(key, value)



    1. Concatenating the two fields

    stub.PutState(visa+typeVisa, value)



    What is the difference between those two approaches?
    What is the best performance?










    share|improve this question
























      0












      0








      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:



      1. Using CompositeKey function provide by stub

      key, err := stub.CreateCompositeKey(indexName,[]stringvisa, typeVisa)
      stub.PutState(key, value)



      1. Concatenating the two fields

      stub.PutState(visa+typeVisa, value)



      What is the difference between those two approaches?
      What is the best performance?










      share|improve this question














      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:



      1. Using CompositeKey function provide by stub

      key, err := stub.CreateCompositeKey(indexName,[]stringvisa, typeVisa)
      stub.PutState(key, value)



      1. 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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 26 at 15:34









      Julian SolarteJulian Solarte

      15012 bronze badges




      15012 bronze badges






















          1 Answer
          1






          active

          oldest

          votes


















          1














          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.






          share|improve this answer






















            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
            );



            );













            draft saved

            draft discarded


















            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









            1














            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.






            share|improve this answer



























              1














              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.






              share|improve this answer

























                1












                1








                1







                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.






                share|improve this answer













                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.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                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


















                    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.



















                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript