Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.1k views
in Technique[技术] by (71.8m points)

amazon web services - Dynamodb transaction limits increase

Currently, I need to update two tables in concurrency and one table contains configurations and other table include items to the configuration link. Now whenever the configuration is updated, it provides me with the list of items that are belong to this configuration(it can be 100-1000 items or more). How can i update the dynamodb using transaction?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Since no more detail was provided I conclude that your application wants to update two DynamoDB tables at the same time (concurrent).

That is not possible.

But there is a way to build something like this with a more AWS-native approach using AWS DynamoDB Streams.

From the documentation:

DynamoDB Streams captures a time-ordered sequence of item-level modifications in any DynamoDB table and stores this information in a log for up to 24 hours. Applications can access this log and view the data items as they appeared before and after they were modified, in near-real time.

Possible solution:

  1. Enable DynamoDB Streams on your configuration table
  2. Configure the stream to send items to a Lambda (that you need to build, see #4)
  3. Change application code to only update configuration table
  4. Create Lambda (see #2) that processes stream items and updates your target table accordingly

With this solution your two tables won't be updated in the same transaction, but it is close to it. There will be extra delay, but it should usually be of no concern.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...