AMAZON DynamoDB(5)DynamoDB Stream
石苏燕
2023-12-01
AMAZON DynamoDB(5)DynamoDB Stream
DynamoDB Stream + Lambda = Database Trigger
DynamoDB Stream will keep the messages for 24 hours. Only one record will be in the stream. Stream will follow the events time line order.
Enable streaming, for example
In overview of your DynamoDB console, there is stream details, Stream enabled, View Type: New and Old Image. Latest stream ARN
There are 4 types for View: Keys only, New Image, Old Image, New and Old Image. In our system, I think previous developer choose “New and old images”. That is expensive.
DynamoDB Update Operation
https://github.com/4ossiblellc/dynamodb-update-expression
No more than 2 processes at most should be reading from the same Streams shard at the same time. Having more than 2 readers per shard may result in throttling." I plan to do it as follow: streams---> lambda ---> SNS
It more than 2 lambda are interested in the streams.
References:
https://blog.csdn.net/hongchangfirst/article/details/47782247
https://www.csdn.net/article/1970-01-01/2825392
https://docs.aws.amazon.com/zh_cn/amazondynamodb/latest/developerguide/Streams.html
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html
https://github.com/4ossiblellc/dynamodb-update-expression