简体   繁体   English

DynamoDB 中的 BatchGetItem 和 TransactionGetItems 有什么区别?

[英]What is the difference between BatchGetItem and TransactionGetItems in DynamoDB?

I have been searching SO for this but I didn't find an answer to this.我一直在寻找这个,但我没有找到答案。 (BatchGetItem vs Query i DID find but not what I'm looking for). (BatchGetItem 与 Query 我确实找到了,但不是我要找的)。 I do know the basics:-我确实知道基础知识:-

BatchGetItem you can request for items from ONE OR MORE TABLES and if the resultset exceeds 100 entities or 16MB -> It will return you an UnprocessedKeys using which you can query the next set of results BatchGetItem您可以从一个或多个表中请求项目,如果结果集超过 100 个实体或 16MB -> 它将返回一个UnprocessedKeys ,您可以使用它来查询下一组结果

"TransactionGetItems" you can request for items from ONE OR MORE TABLES for upto 25 entities or 4MB -> Errors if size of aggregate response exceeds 4MB “TransactionGetItems”您可以从一个或多个表中请求最多 25 个实体或 4MB 的项目 -> 如果聚合响应的大小超过 4MB,则会出错

What then is the use of TransactionGetItems over BatchGetItem ?那么TransactionGetItemsBatchGetItem 有什么用呢? From trawling the docs, I could make out that TransactionGetItems will fail if there are underlying writes happening that impact the same data.通过浏览文档,我可以确定如果发生影响相同数据的底层写入, TransactionGetItems将失败。 Is this the primary use of TransactionGetItems over BatchGetItem , which I assume WONT fail under the same conditions?这是TransactionGetItems而不是BatchGetItem的主要用途吗,我认为它在相同条件下不会失败?

TransactGetItem allows you to have an all or nothing transaction. TransactGetItem 允许您进行全有或全无交易。 Either all GetItem operations in the transactions succeed or none of them do.事务中的所有 GetItem 操作要么成功,要么都不成功。 If one fails, no data is returned.如果失败,则不返回任何数据。 In addition TransactGetItem uses serializable isolation and a plain BatchGetItem does not.此外,TransactGetItem 使用可序列化隔离,而普通的 BatchGetItem 则不使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 DynamoDB GSI BatchGetItem - DynamoDB GSI BatchGetItem 如何将键列表传递给 DynamoDB 增强库并能够使用 BatchGetItem - How pass a List of Keys to DynamoDB enhanced library and to be able to use BatchGetItem 在 dynamodb 中,使用发电机流 + lambda 触发器与运动流 + lambda 触发器有什么区别? - In dynamodb, what is the difference between using dynamo streams + lambda trigger versus kinesis streams + lambda trigger? Kinesis Stream 和 DynamoDB 流之间的区别 - Difference between Kinesis Stream and DynamoDB streams gcloud 和 gsutil 有什么区别? - What is the difference between gcloud and gsutil? getIdToken 和 getAppCheckToken 有什么区别? - What is difference between the getIdToken and getAppCheckToken? AzureMonitorTraceExporter 和 AzureMonitorSpanExporter 有什么区别? - What is the difference between AzureMonitorTraceExporter and AzureMonitorSpanExporter? machineType 和 mixedInstancesPolicy 有什么区别 - What is the difference between machineType and mixedInstancesPolicy Ballerina 中的 final 和 const 有什么区别? - What is the difference between final and const in Ballerina? Amazon SNS 和 Amazon SQS 有什么区别? - What is the difference between Amazon SNS and Amazon SQS?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM