How can I avoid overwriting dynamodb from two lambdas?

Joey Yi Zhao

I am updating dynamodb table from a lambda function. In a high throughput case, there could be multiple lambda instances running at the same time to update the same table. Is there a way to safe guard the table? Whether I can lock the table?

Marcin

There is no build-in mechanism to lock DynamoDB table to safeguard from concurrent overwriting. But there are design patterns which you can implement yourself, or depending on your programing language, find an existing implementation ready to be used, even provided by AWS.

In AWS docs you can find information how to implement Optimistic locking:

Optimistic locking is a strategy to ensure that the client-side item that you are updating (or deleting) is the same as the item in Amazon DynamoDB. If you use this strategy, your database writes are protected from being overwritten by the writes of others, and vice versa.

AWS also provides Amazon DynamoDB Lock Client for java:

The DynamoDB Lock Client implements a protocol allowing similar applications to take advisory locks on any part of your problem domain, big or small. This protocol ensures your players “stay in possession of the ball” for a certain period of time.

And the end of the day, its up to you to design a solution "to safe guard the table" which meets your needs.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

In modern OpenGL, how do I avoid overwriting data in FBO colour attachments with invalid fragments?

分類Dev

How can I avoid the difference of milliseconds between two Chronometers start time?

分類Dev

How can I Scan an index in reverse in DynamoDB?

分類Dev

How can I avoid "no input files" error from sed, when run from xargs?

分類Dev

How can I avoid "environment hell" in postman?

分類Dev

How can I avoid losing precision with ftFmtBcd?

分類Dev

How can I avoid a circular reference situation

分類Dev

Django conditional queries: How can I avoid this?

分類Dev

How can I avoid duplicate templates in Meteor?

分類Dev

How i can avoid the distinct() of watchdog?

分類Dev

How can I avoid problems with CPU power?

分類Dev

How can I retrieve and compare two values from a file?

分類Dev

How can I avoid freezing on Write to socket in Indy if the other end is not reading data from the Socket

分類Dev

Updating the item value in the array, and how can I append the item instead of overwriting it?

分類Dev

How can I achieve better throughput for a large migration to DynamoDB?

分類Dev

How can I achieve better throughput for a large migration to DynamoDB?

分類Dev

How can I avoid nested Navigation Bars in SwiftUI?

分類Dev

How can I avoid running some tests in parallel?

分類Dev

How can I avoid Phusion Passenger running as root?

分類Dev

How can I avoid using 'at' in radial-gradient?

分類Dev

How can i avoid Jquery translate `?` to `%3F`

分類Dev

EXC_BAD_ACCESS - How can I avoid it?

分類Dev

How can i avoid or pass over a directory that is access denied?

分類Dev

How can I avoid repeating the css and not using !important?

分類Dev

How can I avoid a black background when fading in an overlay with ffmpeg?

分類Dev

How to Deploy Lambdas from one code base?

分類Dev

How can I load a WebForms page into an iframe without two full page renders from the server?

分類Dev

Oracle 11g how I can group values from two different columns

分類Dev

How can I use SQL to find a record that is not in a table based on info from two other tables?

Related 関連記事

  1. 1

    In modern OpenGL, how do I avoid overwriting data in FBO colour attachments with invalid fragments?

  2. 2

    How can I avoid the difference of milliseconds between two Chronometers start time?

  3. 3

    How can I Scan an index in reverse in DynamoDB?

  4. 4

    How can I avoid "no input files" error from sed, when run from xargs?

  5. 5

    How can I avoid "environment hell" in postman?

  6. 6

    How can I avoid losing precision with ftFmtBcd?

  7. 7

    How can I avoid a circular reference situation

  8. 8

    Django conditional queries: How can I avoid this?

  9. 9

    How can I avoid duplicate templates in Meteor?

  10. 10

    How i can avoid the distinct() of watchdog?

  11. 11

    How can I avoid problems with CPU power?

  12. 12

    How can I retrieve and compare two values from a file?

  13. 13

    How can I avoid freezing on Write to socket in Indy if the other end is not reading data from the Socket

  14. 14

    Updating the item value in the array, and how can I append the item instead of overwriting it?

  15. 15

    How can I achieve better throughput for a large migration to DynamoDB?

  16. 16

    How can I achieve better throughput for a large migration to DynamoDB?

  17. 17

    How can I avoid nested Navigation Bars in SwiftUI?

  18. 18

    How can I avoid running some tests in parallel?

  19. 19

    How can I avoid Phusion Passenger running as root?

  20. 20

    How can I avoid using 'at' in radial-gradient?

  21. 21

    How can i avoid Jquery translate `?` to `%3F`

  22. 22

    EXC_BAD_ACCESS - How can I avoid it?

  23. 23

    How can i avoid or pass over a directory that is access denied?

  24. 24

    How can I avoid repeating the css and not using !important?

  25. 25

    How can I avoid a black background when fading in an overlay with ffmpeg?

  26. 26

    How to Deploy Lambdas from one code base?

  27. 27

    How can I load a WebForms page into an iframe without two full page renders from the server?

  28. 28

    Oracle 11g how I can group values from two different columns

  29. 29

    How can I use SQL to find a record that is not in a table based on info from two other tables?

ホットタグ

アーカイブ