How GraphQL handle “Two Phase Commits” in MongoDB?









up vote
1
down vote

favorite
1












MongoDB has a "Two Phase Commits" concept.




Operations on a single document are always atomic with MongoDB databases; however, operations that involve multiple documents, which are often referred to as “multi-document transactions”, are not atomic. Since documents can be fairly complex and contain multiple “nested” documents, single-document atomicity provides the necessary support for many practical use cases.https://docs.mongodb.com/v3.4/tutorial/perform-two-phase-commits/




Since as Schema in GraphQL create separate document, How GraphQL handle this?










share|improve this question

























    up vote
    1
    down vote

    favorite
    1












    MongoDB has a "Two Phase Commits" concept.




    Operations on a single document are always atomic with MongoDB databases; however, operations that involve multiple documents, which are often referred to as “multi-document transactions”, are not atomic. Since documents can be fairly complex and contain multiple “nested” documents, single-document atomicity provides the necessary support for many practical use cases.https://docs.mongodb.com/v3.4/tutorial/perform-two-phase-commits/




    Since as Schema in GraphQL create separate document, How GraphQL handle this?










    share|improve this question























      up vote
      1
      down vote

      favorite
      1









      up vote
      1
      down vote

      favorite
      1






      1





      MongoDB has a "Two Phase Commits" concept.




      Operations on a single document are always atomic with MongoDB databases; however, operations that involve multiple documents, which are often referred to as “multi-document transactions”, are not atomic. Since documents can be fairly complex and contain multiple “nested” documents, single-document atomicity provides the necessary support for many practical use cases.https://docs.mongodb.com/v3.4/tutorial/perform-two-phase-commits/




      Since as Schema in GraphQL create separate document, How GraphQL handle this?










      share|improve this question













      MongoDB has a "Two Phase Commits" concept.




      Operations on a single document are always atomic with MongoDB databases; however, operations that involve multiple documents, which are often referred to as “multi-document transactions”, are not atomic. Since documents can be fairly complex and contain multiple “nested” documents, single-document atomicity provides the necessary support for many practical use cases.https://docs.mongodb.com/v3.4/tutorial/perform-two-phase-commits/




      Since as Schema in GraphQL create separate document, How GraphQL handle this?







      mongodb graphql






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 9 at 14:05









      ali karimi

      1027




      1027






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          4
          down vote













          GraphQL doesn't have any intrinsic notion of transactions or atomicity. The only statement along these lines is that multiple top-level fields in a single mutation are resolved serially with the expectation that later mutations will see side effects from previous ones. If you have multiple changes in a single GraphQL call and a later one fails, GraphQL says absolutely nothing about whether a first one should be rolled back.



          If you're implementing a GraphQL schema in a way that requires changing multiple documents or records, it's up to you as an implementer (or possibly an intermediate library you're using) to provide whatever atomicity and consistency guarantees you need. GraphQL doesn't provide anything here.






          share|improve this answer




















          • Thanks for your answer.Are you know library that handle this?
            – ali karimi
            Nov 9 at 17:43










          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',
          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%2f53227229%2fhow-graphql-handle-two-phase-commits-in-mongodb%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          4
          down vote













          GraphQL doesn't have any intrinsic notion of transactions or atomicity. The only statement along these lines is that multiple top-level fields in a single mutation are resolved serially with the expectation that later mutations will see side effects from previous ones. If you have multiple changes in a single GraphQL call and a later one fails, GraphQL says absolutely nothing about whether a first one should be rolled back.



          If you're implementing a GraphQL schema in a way that requires changing multiple documents or records, it's up to you as an implementer (or possibly an intermediate library you're using) to provide whatever atomicity and consistency guarantees you need. GraphQL doesn't provide anything here.






          share|improve this answer




















          • Thanks for your answer.Are you know library that handle this?
            – ali karimi
            Nov 9 at 17:43














          up vote
          4
          down vote













          GraphQL doesn't have any intrinsic notion of transactions or atomicity. The only statement along these lines is that multiple top-level fields in a single mutation are resolved serially with the expectation that later mutations will see side effects from previous ones. If you have multiple changes in a single GraphQL call and a later one fails, GraphQL says absolutely nothing about whether a first one should be rolled back.



          If you're implementing a GraphQL schema in a way that requires changing multiple documents or records, it's up to you as an implementer (or possibly an intermediate library you're using) to provide whatever atomicity and consistency guarantees you need. GraphQL doesn't provide anything here.






          share|improve this answer




















          • Thanks for your answer.Are you know library that handle this?
            – ali karimi
            Nov 9 at 17:43












          up vote
          4
          down vote










          up vote
          4
          down vote









          GraphQL doesn't have any intrinsic notion of transactions or atomicity. The only statement along these lines is that multiple top-level fields in a single mutation are resolved serially with the expectation that later mutations will see side effects from previous ones. If you have multiple changes in a single GraphQL call and a later one fails, GraphQL says absolutely nothing about whether a first one should be rolled back.



          If you're implementing a GraphQL schema in a way that requires changing multiple documents or records, it's up to you as an implementer (or possibly an intermediate library you're using) to provide whatever atomicity and consistency guarantees you need. GraphQL doesn't provide anything here.






          share|improve this answer












          GraphQL doesn't have any intrinsic notion of transactions or atomicity. The only statement along these lines is that multiple top-level fields in a single mutation are resolved serially with the expectation that later mutations will see side effects from previous ones. If you have multiple changes in a single GraphQL call and a later one fails, GraphQL says absolutely nothing about whether a first one should be rolled back.



          If you're implementing a GraphQL schema in a way that requires changing multiple documents or records, it's up to you as an implementer (or possibly an intermediate library you're using) to provide whatever atomicity and consistency guarantees you need. GraphQL doesn't provide anything here.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 9 at 15:08









          David Maze

          7,6142820




          7,6142820











          • Thanks for your answer.Are you know library that handle this?
            – ali karimi
            Nov 9 at 17:43
















          • Thanks for your answer.Are you know library that handle this?
            – ali karimi
            Nov 9 at 17:43















          Thanks for your answer.Are you know library that handle this?
          – ali karimi
          Nov 9 at 17:43




          Thanks for your answer.Are you know library that handle this?
          – ali karimi
          Nov 9 at 17:43

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53227229%2fhow-graphql-handle-two-phase-commits-in-mongodb%23new-answer', 'question_page');

          );

          Post as a guest














































































          Popular posts from this blog

          Use pre created SQLite database for Android project in kotlin

          Darth Vader #20

          Ondo