Saving a new row in DynamoDB and then listing all those items with eventual read consistency?Dynamodb checking for uniqueness across primary key AND another fieldDynamoDB eventually consistence read ordering for sequential written dataConfused by AWS DynamoDB with UserIDHow to tackle eventual consistency issues on AWSAWS IAM Fine-Grained Access Control though APIGateway and LambdaDoes Terraform offer strong consistency with S3 and DynamoDB?Using AWS To Process Large Amounts Of Data With ServerlessDynamoDB Eventually consistent reads vs Strongly consistent readsHow to handle eventually consistent reads in DynamoDBAWS DynamoDB. Am I overusing my write capacity?

Can I Retrieve Email Addresses from BCC?

voltage of sounds of mp3files

Why does John Bercow say “unlock” after reading out the results of a vote?

Is there an Impartial Brexit Deal comparison site?

Can somebody explain Brexit in a few child-proof sentences?

What to do with wrong results in talks?

Ways to speed up user implemented RK4

Displaying the order of the columns of a table

What are the ramifications of creating a homebrew world without an Astral Plane?

Why Were Madagascar and New Zealand Discovered So Late?

Implement the Thanos sorting algorithm

Where in the Bible does the greeting ("Dominus Vobiscum") used at Mass come from?

What's a natural way to say that someone works somewhere (for a job)?

What would be the benefits of having both a state and local currencies?

Everything Bob says is false. How does he get people to trust him?

Trouble understanding overseas colleagues

Print name if parameter passed to function

I'm in charge of equipment buying but no one's ever happy with what I choose. How to fix this?

Have I saved too much for retirement so far?

The baby cries all morning

Was the picture area of a CRT a parallelogram (instead of a true rectangle)?

How to be diplomatic in refusing to write code that breaches the privacy of our users

How can I get through very long and very dry, but also very useful technical documents when learning a new tool?

Efficiently merge handle parallel feature branches in SFDX



Saving a new row in DynamoDB and then listing all those items with eventual read consistency?


Dynamodb checking for uniqueness across primary key AND another fieldDynamoDB eventually consistence read ordering for sequential written dataConfused by AWS DynamoDB with UserIDHow to tackle eventual consistency issues on AWSAWS IAM Fine-Grained Access Control though APIGateway and LambdaDoes Terraform offer strong consistency with S3 and DynamoDB?Using AWS To Process Large Amounts Of Data With ServerlessDynamoDB Eventually consistent reads vs Strongly consistent readsHow to handle eventually consistent reads in DynamoDBAWS DynamoDB. Am I overusing my write capacity?













0















So imagine we have a web frontend & API Gateway/Lambda/DynamoDB backend.



The user navigates to the "Add Project" page where they type the name of the new Project and click Save, this then navigates to a list of Projects (which should include the one they just added).



Because the read in DynamoDB is eventual by default, it is possible that the user would click save and then not see their new Project listed on the next page - this could cause confusion and if they entered a lot of information a bit of panic.



Is it a good pattern to have the backend accept an additional param to say "strongly consistent read" on the "getProjects" call? Or is there another way to deal with this?










share|improve this question


























    0















    So imagine we have a web frontend & API Gateway/Lambda/DynamoDB backend.



    The user navigates to the "Add Project" page where they type the name of the new Project and click Save, this then navigates to a list of Projects (which should include the one they just added).



    Because the read in DynamoDB is eventual by default, it is possible that the user would click save and then not see their new Project listed on the next page - this could cause confusion and if they entered a lot of information a bit of panic.



    Is it a good pattern to have the backend accept an additional param to say "strongly consistent read" on the "getProjects" call? Or is there another way to deal with this?










    share|improve this question
























      0












      0








      0








      So imagine we have a web frontend & API Gateway/Lambda/DynamoDB backend.



      The user navigates to the "Add Project" page where they type the name of the new Project and click Save, this then navigates to a list of Projects (which should include the one they just added).



      Because the read in DynamoDB is eventual by default, it is possible that the user would click save and then not see their new Project listed on the next page - this could cause confusion and if they entered a lot of information a bit of panic.



      Is it a good pattern to have the backend accept an additional param to say "strongly consistent read" on the "getProjects" call? Or is there another way to deal with this?










      share|improve this question














      So imagine we have a web frontend & API Gateway/Lambda/DynamoDB backend.



      The user navigates to the "Add Project" page where they type the name of the new Project and click Save, this then navigates to a list of Projects (which should include the one they just added).



      Because the read in DynamoDB is eventual by default, it is possible that the user would click save and then not see their new Project listed on the next page - this could cause confusion and if they entered a lot of information a bit of panic.



      Is it a good pattern to have the backend accept an additional param to say "strongly consistent read" on the "getProjects" call? Or is there another way to deal with this?







      amazon-web-services amazon-dynamodb serverless






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 8 at 9:45









      Force HeroForce Hero

      407516




      407516






















          1 Answer
          1






          active

          oldest

          votes


















          1














          It's actually a good pattern to do a consistent read after you insert or update an item. An example of this can be seen at the DynamoDB docs when describing CRUD operations



          A common pattern I've done in the past when working with web applications is to end any POST/PUT request with a redirect to a GET in which I enable strong consistency. That gives strong consistency to the list immediately after inserting. In most cases users will just do nothing after inserting, will navigate to a different part of the application, or will click to see the details of the item.



          Let's suppose the user clicks on the item in the list to see the details. Theoretically it might not be propagated yet (although chances is it will be, because DynamoDB replication tends to be very fast). Another pattern I have used in the past is for detail pages I issue an eventual request, but if I get no results, instead of returning not found directly to the end user, I retry once the read with consistency. If it returns no results, then I return the not found, but if it was just a propagation issue, then you are good to go.






          share|improve this answer























          • Thanks, this is useful. In your last para, you said suppose they click the item but theoretically it might not be propagated - if it's listed it will have propagated won't it? Does the consistent read wait for propagation or does it attempt to read from 2 of 3 DDb instances and will therefore always get the record if it exists?

            – Force Hero
            Mar 8 at 11:00











          • You cannot assume anything, as the underlying mechanism might change over time. The contract between DynamoDB and you is that if you want to be sure you get consistent data, you need to issue a consistent read. Having executed a consistent read before is not a guarantee that the next inconsistent read will have the latest data. As you well said, it might be the case the consistent read is using a quorum mechanism, but that's an implementation detail that it's not part of the API contract.

            – Javier Ramirez
            Mar 8 at 11:24






          • 1





            Got it, crystal clear. Thanks for your help!

            – Force Hero
            Mar 8 at 11:53










          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%2f55060527%2fsaving-a-new-row-in-dynamodb-and-then-listing-all-those-items-with-eventual-read%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














          It's actually a good pattern to do a consistent read after you insert or update an item. An example of this can be seen at the DynamoDB docs when describing CRUD operations



          A common pattern I've done in the past when working with web applications is to end any POST/PUT request with a redirect to a GET in which I enable strong consistency. That gives strong consistency to the list immediately after inserting. In most cases users will just do nothing after inserting, will navigate to a different part of the application, or will click to see the details of the item.



          Let's suppose the user clicks on the item in the list to see the details. Theoretically it might not be propagated yet (although chances is it will be, because DynamoDB replication tends to be very fast). Another pattern I have used in the past is for detail pages I issue an eventual request, but if I get no results, instead of returning not found directly to the end user, I retry once the read with consistency. If it returns no results, then I return the not found, but if it was just a propagation issue, then you are good to go.






          share|improve this answer























          • Thanks, this is useful. In your last para, you said suppose they click the item but theoretically it might not be propagated - if it's listed it will have propagated won't it? Does the consistent read wait for propagation or does it attempt to read from 2 of 3 DDb instances and will therefore always get the record if it exists?

            – Force Hero
            Mar 8 at 11:00











          • You cannot assume anything, as the underlying mechanism might change over time. The contract between DynamoDB and you is that if you want to be sure you get consistent data, you need to issue a consistent read. Having executed a consistent read before is not a guarantee that the next inconsistent read will have the latest data. As you well said, it might be the case the consistent read is using a quorum mechanism, but that's an implementation detail that it's not part of the API contract.

            – Javier Ramirez
            Mar 8 at 11:24






          • 1





            Got it, crystal clear. Thanks for your help!

            – Force Hero
            Mar 8 at 11:53















          1














          It's actually a good pattern to do a consistent read after you insert or update an item. An example of this can be seen at the DynamoDB docs when describing CRUD operations



          A common pattern I've done in the past when working with web applications is to end any POST/PUT request with a redirect to a GET in which I enable strong consistency. That gives strong consistency to the list immediately after inserting. In most cases users will just do nothing after inserting, will navigate to a different part of the application, or will click to see the details of the item.



          Let's suppose the user clicks on the item in the list to see the details. Theoretically it might not be propagated yet (although chances is it will be, because DynamoDB replication tends to be very fast). Another pattern I have used in the past is for detail pages I issue an eventual request, but if I get no results, instead of returning not found directly to the end user, I retry once the read with consistency. If it returns no results, then I return the not found, but if it was just a propagation issue, then you are good to go.






          share|improve this answer























          • Thanks, this is useful. In your last para, you said suppose they click the item but theoretically it might not be propagated - if it's listed it will have propagated won't it? Does the consistent read wait for propagation or does it attempt to read from 2 of 3 DDb instances and will therefore always get the record if it exists?

            – Force Hero
            Mar 8 at 11:00











          • You cannot assume anything, as the underlying mechanism might change over time. The contract between DynamoDB and you is that if you want to be sure you get consistent data, you need to issue a consistent read. Having executed a consistent read before is not a guarantee that the next inconsistent read will have the latest data. As you well said, it might be the case the consistent read is using a quorum mechanism, but that's an implementation detail that it's not part of the API contract.

            – Javier Ramirez
            Mar 8 at 11:24






          • 1





            Got it, crystal clear. Thanks for your help!

            – Force Hero
            Mar 8 at 11:53













          1












          1








          1







          It's actually a good pattern to do a consistent read after you insert or update an item. An example of this can be seen at the DynamoDB docs when describing CRUD operations



          A common pattern I've done in the past when working with web applications is to end any POST/PUT request with a redirect to a GET in which I enable strong consistency. That gives strong consistency to the list immediately after inserting. In most cases users will just do nothing after inserting, will navigate to a different part of the application, or will click to see the details of the item.



          Let's suppose the user clicks on the item in the list to see the details. Theoretically it might not be propagated yet (although chances is it will be, because DynamoDB replication tends to be very fast). Another pattern I have used in the past is for detail pages I issue an eventual request, but if I get no results, instead of returning not found directly to the end user, I retry once the read with consistency. If it returns no results, then I return the not found, but if it was just a propagation issue, then you are good to go.






          share|improve this answer













          It's actually a good pattern to do a consistent read after you insert or update an item. An example of this can be seen at the DynamoDB docs when describing CRUD operations



          A common pattern I've done in the past when working with web applications is to end any POST/PUT request with a redirect to a GET in which I enable strong consistency. That gives strong consistency to the list immediately after inserting. In most cases users will just do nothing after inserting, will navigate to a different part of the application, or will click to see the details of the item.



          Let's suppose the user clicks on the item in the list to see the details. Theoretically it might not be propagated yet (although chances is it will be, because DynamoDB replication tends to be very fast). Another pattern I have used in the past is for detail pages I issue an eventual request, but if I get no results, instead of returning not found directly to the end user, I retry once the read with consistency. If it returns no results, then I return the not found, but if it was just a propagation issue, then you are good to go.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 8 at 10:24









          Javier RamirezJavier Ramirez

          1,8531022




          1,8531022












          • Thanks, this is useful. In your last para, you said suppose they click the item but theoretically it might not be propagated - if it's listed it will have propagated won't it? Does the consistent read wait for propagation or does it attempt to read from 2 of 3 DDb instances and will therefore always get the record if it exists?

            – Force Hero
            Mar 8 at 11:00











          • You cannot assume anything, as the underlying mechanism might change over time. The contract between DynamoDB and you is that if you want to be sure you get consistent data, you need to issue a consistent read. Having executed a consistent read before is not a guarantee that the next inconsistent read will have the latest data. As you well said, it might be the case the consistent read is using a quorum mechanism, but that's an implementation detail that it's not part of the API contract.

            – Javier Ramirez
            Mar 8 at 11:24






          • 1





            Got it, crystal clear. Thanks for your help!

            – Force Hero
            Mar 8 at 11:53

















          • Thanks, this is useful. In your last para, you said suppose they click the item but theoretically it might not be propagated - if it's listed it will have propagated won't it? Does the consistent read wait for propagation or does it attempt to read from 2 of 3 DDb instances and will therefore always get the record if it exists?

            – Force Hero
            Mar 8 at 11:00











          • You cannot assume anything, as the underlying mechanism might change over time. The contract between DynamoDB and you is that if you want to be sure you get consistent data, you need to issue a consistent read. Having executed a consistent read before is not a guarantee that the next inconsistent read will have the latest data. As you well said, it might be the case the consistent read is using a quorum mechanism, but that's an implementation detail that it's not part of the API contract.

            – Javier Ramirez
            Mar 8 at 11:24






          • 1





            Got it, crystal clear. Thanks for your help!

            – Force Hero
            Mar 8 at 11:53
















          Thanks, this is useful. In your last para, you said suppose they click the item but theoretically it might not be propagated - if it's listed it will have propagated won't it? Does the consistent read wait for propagation or does it attempt to read from 2 of 3 DDb instances and will therefore always get the record if it exists?

          – Force Hero
          Mar 8 at 11:00





          Thanks, this is useful. In your last para, you said suppose they click the item but theoretically it might not be propagated - if it's listed it will have propagated won't it? Does the consistent read wait for propagation or does it attempt to read from 2 of 3 DDb instances and will therefore always get the record if it exists?

          – Force Hero
          Mar 8 at 11:00













          You cannot assume anything, as the underlying mechanism might change over time. The contract between DynamoDB and you is that if you want to be sure you get consistent data, you need to issue a consistent read. Having executed a consistent read before is not a guarantee that the next inconsistent read will have the latest data. As you well said, it might be the case the consistent read is using a quorum mechanism, but that's an implementation detail that it's not part of the API contract.

          – Javier Ramirez
          Mar 8 at 11:24





          You cannot assume anything, as the underlying mechanism might change over time. The contract between DynamoDB and you is that if you want to be sure you get consistent data, you need to issue a consistent read. Having executed a consistent read before is not a guarantee that the next inconsistent read will have the latest data. As you well said, it might be the case the consistent read is using a quorum mechanism, but that's an implementation detail that it's not part of the API contract.

          – Javier Ramirez
          Mar 8 at 11:24




          1




          1





          Got it, crystal clear. Thanks for your help!

          – Force Hero
          Mar 8 at 11:53





          Got it, crystal clear. Thanks for your help!

          – Force Hero
          Mar 8 at 11:53



















          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%2f55060527%2fsaving-a-new-row-in-dynamodb-and-then-listing-all-those-items-with-eventual-read%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

          Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

          Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

          2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived