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

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현