MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.23k stars 21.41k forks source link

How to do atomic transaction in Azure cosmosdb Gremlin api? #80846

Closed satyajitcet closed 3 years ago

satyajitcet commented 3 years ago

Azure documentation issue guidance

Tech support and product feedback

Technology Used - Azure CosmosDB gremlin API Language Used - Java Integration Library - Apache Tinkerpop Gremlin Driver Problem: We are using 2 graphs (Let GraphA & GraphB) in single database. for 1 transaction we need to update vertices and edges of GraphA and GraphB. Need update in both graphs else no update in any single graph. Is CosmosDB providing any feature to make multiple query with more than 1 graph as a single transaction?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

BhargaviAnnadevara commented 3 years ago

@satyajitcet Thank you for the question. In order to best address your question, could you provide us with the URL of the MS Doc that you were following, if any?

satyajitcet commented 3 years ago

I am following below document. https://docs.microsoft.com/en-us/azure/cosmos-db/graph/graph-introduction I have not found any topic related to atomic transaction.so asked here.

KalyanChanumolu-MSFT commented 3 years ago

@satyajitcet CosmosDB doesn't provide a separate SDK for Gremlin API. You can use any Gremlin client that is based on Apache TinkerPop specifications that supports transactions.

Please read more about transactions on the TinkerPop documentation here

satyajitcet commented 3 years ago

Question is whether Azure cosmos db gremlin api is providing atomic transaction or not.if it is providing atomic transaction then where is it atomic? Can we make below scenario atomic using cosmos db gremlin api? We are using 2 graphs (Let GraphA & GraphB) in single database. for 1 transaction we need to update vertices and edges of GraphA and GraphB. Need update in both graphs else no update in any single graph. Is CosmosDB providing any feature to make multiple query with more than 1 graph as a single transaction?

KalyanChanumolu-MSFT commented 3 years ago

@satyajitcet Thank you for providing additional context. Cosmos DB provides support for transactions within a partition, we do not have support multi-step, cross-partition, or distributed transactions.

I am tagging @manishmsfte to provide more insights on your scenario.

KalyanChanumolu-MSFT commented 3 years ago

@satyajitcet I have verified this, transactions across graphs are not supported at this time.

KalyanChanumolu-MSFT commented 3 years ago

We will proceed to close this issue now. If there are further questions regarding this matter, please comment and we will gladly continue the discussion.