作为一项原子操作,将其插入到天蓝色cosmos db中的多个容器中 [英] Inserting to a number of containers in azure cosmos db as one atomic operation
问题描述
我是Azure Cosmos DB的新手.
I'm a little new to Azure Cosmos DB.
我想知道它是否可以选择将多个容器上的多个操作作为一个原子操作进行.例如,所有操作都是从.NET后端成功或失败.
I wanted to know if it has an option to make a number of operations on multiple containers as one atomic operation. E.g., all succeed or or fail from a .NET backend.
推荐答案
对于单个容器中的单个操作而言,操作是原子的.如果您使用存储过程,则可以在单个容器内的单个分区内执行一系列原子操作.
Operations are atomic to a single operation in a single container. If you use a Stored Procedure, you may perform an atomic set of multiple operations within a single partition within a single container.
您不能跨多个容器或单个容器的多个分区执行任何原子操作.这与您使用的语言环境(例如您提到的.NET)无关.这就是Cosmos DB服务的工作方式.
You cannot perform any atomic operations across multiple containers, or across multiple partitions of a single container. This has nothing to do with which language environment (e.g. .NET as you mentioned) you're using. This is just how the Cosmos DB service works.
这篇关于作为一项原子操作,将其插入到天蓝色cosmos db中的多个容器中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!