I am new to Azure Cosmos DB. I have created Azure Cosmos DB with SQL API and loaded the data and used SQL Queries. Now I want to access the Mongo API of the same DB. Is it possible?
Upon online search, I found confusing answers.
Connecting The Same Cosmos DB Database Using SQL API And Mongo API From A Blazor App
The extensible APIs that you can use include .NET, .NET Core, Node.js, Java, Python, and MongoDB. If you’re using .NET, you can use DocumentDB API, MongoDB API, Graph API, or Table API. Java and Node.js will only work with the Document DB APIs, MongoDB APIs, and Graph APIs. Python will only work with the DocumentDB API, and Gremlin, only the Graph API.
I understand that the same DB can be accessed with SQL API and Mongo API, as long as I use .NET
Am I right?
If yes, please let me know the procedure.
I understand that the same DB can be accessed with SQL API and Mongo
API, as long as I use .NET
Am I right?
No. While it might be technically possible, it is not supported to use multiple APIs. You have to stick to the one that you chose when creating the database.
The only exception is Gremlin and SQL API.
https://learn.microsoft.com/en-us/azure/cosmos-db/faq#can-i-use-multiple-apis-to-access-my-data
Related
Does anybody know if there is a way you can import data into an Azure SQL Database, using an GraphQL API? Or if you could create a connection within an iPaas system to send data to the Azure SQL database?
Since you want to exchange data between azure sql database and GraphQl.
Directus can be used which is an open-source Data Platform that enables anyone to access and manage the database content.
Directus will give us a GraphQl API to be used with the data .
Refer the following article to setup the azure sql database and directus .
Does Azure function work with triggers,input,output bindings for CosmosDB with MongoApi? Are there any way past this apart from using a MongoClient?
As documented here, Cosmos DB bindings are specific to the SQL API.
For any other binding (such as MongoDB API, which you're asking about, or Cassandra, Gremlin, etc), you'd need to use a language-specific client SDK. In your case you'd need to work with a MongoDB client from your Azure Function.
Is it possible to call REST Api (Azure Application Insights Api) from Azure Serverless Database Stored Procedures?
It seems, SQL CLR is not available for Azure Serverless Sql Database. Any other options?
According to the official document, CLR Stored Procedures are supported only on SQL Database Managed Instances.
At this moment, there's no integration between SQL Database and Event Grid, so your only option is to perform the http request right after the commit operation in your SQL.
https://learn.microsoft.com/en-us/azure/azure-sql/database/features-comparison
Is there a path to follow where you can interface with Azures CosmosDB using GraphQL along with an Azure Functions interface if there needs to be a place where logic is executed.
I have started on a project Eklee-Azure-Functions-GraphQl to implement a GraphQL interface served by Azure HTTP function(s). It currently supports Azure Cosmos DB SQL API. The GraphQL interface is using graphql-dotnet. It uses a Model-first approach to define and automatically generate your schema. It supports both query and mutation.
As far as I know CosmoDB at this time only supports these APIs:
Standard SQL
MongoDB
Cassandra
Azure Table
Gremlin
If you want to use the GraphQL protocol to query it, you might need to create a wrapper, that translates the GraphQL queries to the appropriate interface.
I would suggest to go for a MongoDB API and implement functions that accept the GraphQL queries and interact with the MongoDB. This should be easy, because MongoDBs queries are looking pretty the same [1].
[1] https://medium.com/the-ideal-system/graphql-and-mongodb-a-quick-example-34643e637e49
I've published a demo of using GraphQL backed by the Azure Cosmos SQL API https://github.com/southpolesteve/graphql-cosmos-demo. It could easily be hosted on Azure Functions
A .Net Core Web App, connect with Cosmos DB using SQL API, if running it on Azure as a Web App, a query takes more than 30ms, however, if running the same web app on a Windows 10 PC, connect to the same CosmosDB, same query takes 10~11ms.
If connect to Cosmos DB using Mongo API, then performance looks better, a query takes 5~6ms if running on Azure.
I'd like to know why there's such a big performance difference between SQL API and Mongo API? Is there any thing I need to pay attention on to make performance better? Thanks.