Use SQL Server to query CosmosDB - azure-cosmosdb

Is there a way to query CosmosDB from SQL Server 2016 SSMS? I'm currently querying CosmosDB using the DocumentDB ODBC driver via SSIS. Users are now asking for the ability to query CosmosDB directly from SSMS through some sort of view.

Yes there is, you can use Linked Servers. For more information,
https://samtran.me/2017/10/07/linked-servers-for-azures-nosql-cosmosdb/

SQL Server Management Studio makes use of SqlClient underneath, which makes the main GUI only compatible with SQL Server databases. Using Linked Servers might not work yet either, since SQL Server doesn't support DocDB drivers.

Related

Can I connect Alteryx to CosmoDB

I have a project where my end users are using Alteryx to combine data sources and import into SQL server. We are investigating changing SQL server to CosmoDB but I'm not sure if connecting to CosmoDB is supported by Alteryx.
Do anyone know if there is a connector? Am I overthinking this? I don't know Alteryx very well.
There is currently no dedicated connector from Azure Cosmos DB.
However, the Azure Cosmos DB ODBC driver enables you to connect to Azure Cosmos DB using BI analytics tools.
Also, there is an existing REST API for Cosmos DB, it should be possible to access it through a Downloaded tool. You can suggest in the idea section of Alteryx Community to request one.

Can Application Insights automatically track queries to Cosmos Db with connection mode Direct?

Currently in Application Insights we are only seeing these operations between our .Net Core application and Cosmos db
but queries to actually query and insert data is not seen. We are using Direct connection mode as per the performance tips https://learn.microsoft.com/en-us/azure/cosmos-db/performance-tips.
Do we have to manually track these queries or can this be done automatically, like when using Sql Server.
I turns out that queries to cosmos db using Direct connection mode are not automatically tracked, as stated here: https://learn.microsoft.com/en-us/azure/azure-monitor/app/asp-net-dependencies#automatically-tracked-dependencies
So all queries to Cosmos db must be tracked manually.

CosmoDB with Qt

Hello and I am new to developing with Qt for cross platform development. My current goal is to be able to cache data from a CosmosDB with my app that I've developed in Qt. I've had no problem setting up the CosmosDB, but I am confused at what the best way to communicate with the database is.
Do I need to create my own API to talk with the database? Are there libraries out there already do what I want?
You can use either standard HTTP requests, or use SQL API.
Azure Cosmos DB exposes resources through the REST APIs that can be called by HTTP/HTTPS requests. How can I develop apps with the SQL API
Azure Cosmos DB REST API reference
Also Azure Cosmos DB offers a query language as an interface to query JSON documents. The language supports a subset of ANSI SQL grammar and adds deep integration of JavaScript object, arrays, object construction, and function invocation. Microsoft shows exmaples here

Using redis with SQL server

I am developing a web app and came across redis for key value storage. I do have a relational db SQL server. But as I have a multi tenancy system there will be separate schemas for each customer.
I was thinking how viable would it be use both redis and SQL server together? I was thinking of storing user Id and schemas so then can connect to SQL server db for that user
It's perfectly viable to use both Redis and SQL Server together.
With more details about the kinds of schema differences you expect, we might be able to provide more insight.

confused about local data storage for occasionally connected application in .NET

Can I use a SQL Server Express database as my local database for an occasionally connected application (OCA) written using Visual Studio? Would that require SQL Server to be installed on the client machine? It looks like the default architecture for OCAs in .NET is to use SQL Server Compact. However, SQL Server Compact doesn't permit the use of stored procedures. I use stored procedures for all the data access in my application so, I am confused about the best way to create an occasionally connected client to extend the functionality.
I currently have an ASP.NET web application that connects to a web service (WCF). The web service connects to the DB and calls stored procedures to get data and submit changes to data. Now, I am trying to write a desktop application that can connect to the web service when a connection is available, and work locally when a connection is not available, using the MS Sync Framework. I don't quite understand how to do the architecture for this bit.
Yes, local data cache works with SQL CE 3.5 and you cannot use stored procedures on the cache. Once you add local data cache item to your project it automatically prepares all necessary MS Sync Framework code for data synchronization with the main data source + all necessary SQL scripts for local database and it will also offer you to create either typed datasets or entity data model to access the cache from your application.
Item doesn't work with SQL Server Express - it doesn't offer any other data provider then SQL Compact 3.5. Anyway if you want to use SQL Server Express you will have to either install it on the client machine or use another machine as DB server which breaks whole purpose of Local data cache.
Btw. I think Local data cache works only against database as the main data source so you cannot use it if you want to have WCF services as data source and you will have to write the store and synchronization yourselves.

Resources