简体   繁体   中英

Dynamodb update item at a same time

I have a dynamodb table called events

table schema is

partition_key : <user_id>
sort_key : <month>
attributes: [<list of user events>]

I opened 3 terminals and running update_item command at the sametime for same partition_key and sort_key

Question:

How DynamoDb works in this case?

Will Dynamodb follows any approach like FIFO ?

OR

will Dynamodb performs update_item operation parlalley for the same partition key and sort key ?

Can someone tell me how Dyanmodb works?

How DynamoDb works is explained in the excellent AWS presentation:

The relevant part to your question is at 6.46 minute, where they talk about storage leader nodes . So when you put or update the same item, your requests will go to a single, specific storage leader node responsible for the partition where the item exists. This means, that all your concurrent updates will end up in the single node. The node probably (not explicitly stated) will be able to queue the requests, in presumably a similar way as for global tables discussed at time 51.58 , which is "last writer wins" based on timestamp.

There are other questions discussing similar topics, eg here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM