Questions tagged [azure-cosmosdb]

Azure Cosmos DB is Microsoft's fully managed and serverless distributed database with support for NoSQL and relational workloads. It offers global distribution across all Azure regions transparently replicating your data wherever your users are. Develop applications using open-source database engines, including PostgreSQL, MongoDB, and Cassandra. Get automatic scalability, enterprise-grade security, and cost-effective consumption-based pricing.

Azure Cosmos DB is a fully managed, distributed NoSQL and relational database for modern app development. Get single-digit millisecond response times and up to 99.999-percent availability, backed by SLAs. Build cloud-native apps quickly and easily using your preferred tools with support for open-source PostgreSQL, MongoDB and Apache Cassandra. Enjoy automatic and instant scalability, and fast writes and reads anywhere in the world with turnkey data replication and multi-region writes. Gain insight over real-time data with no-ETL analytics using Azure Synapse Link for Azure Cosmos DB.

7404 questions
19
votes
1 answer

Is DocumentDB slower than SQL at pulling lots of records?

I was doing some benchmarking, so I had a SQL database with 2500 records. I inserted those records into DocumentDB. I wrote two lines of code, one with entity framework to pull all 2500 into an array in C#. The next line to pull all 2500 into an…
bladefist
  • 1,084
  • 3
  • 15
  • 25
18
votes
2 answers

How to start a new connection with CosmoDB graph database using gremlin on version ^3

I am trying to create a new gremlin client in node js, but I cannot find any documentation how to set up the connection with both a URL and a primary key (as generated in Azure CosmosDB). Examples are available how to do this in versions < v3, such…
18
votes
1 answer

Azure DocumentDB Read Document Resource Not Found

I'm building a .Net Console application to read information in a DocumentDB. The console app has data coming from an EventHub and inserts/updates recent data as it comes into the cloud. I am trying to read a singular document from DocumentDB and I…
Andrew Konken
  • 342
  • 1
  • 3
  • 17
17
votes
3 answers

Azure Cosmos DB Emulator - Invalid SSL Certificate

Normally I would launch Azure Cosmos DB Emulator.exe (installed on Windows 10) and it would launch Chrome at https://localhost:8081/_explorer/index.htm saying "Congratulations! Your Azure Cosmos DB emulator is running.", easy peasy. But today I have…
17
votes
2 answers

Could not retrieve the list of available versions for provider Terraform Azure

Based on PR: https://github.com/terraform-providers/terraform-provider-azurerm/pull/5325 azurerm provider version 1.42.0 is required so as to by default install the cosmosdb account with server version 3.6. To achieve this i have added the below in…
Vaishnav
  • 611
  • 1
  • 9
  • 23
17
votes
3 answers

PartitionKey extracted from document doesn't match the one specified in the header on CreateItemAsync

I have a bit of a problem using Microsoft.Azure.Cosmos version 3.2.0, upon running await this.Container.CreateItemAsync(logEntity, new PartitionKey("anythingIPutHere")); it throws Microsoft.Azure.Cosmos.CosmosException …
Gabriel P.
  • 3,400
  • 2
  • 32
  • 23
17
votes
4 answers

Pagination in Cosmos DB using Page Size and Page Number

I am trying to return items from cosmosDB using PageSize and PageNumber. I know we can set the page size in MaxItemCount, but how do we put the page number in this function? Here's what I got so far: public async Task>…
superninja
  • 3,114
  • 7
  • 30
  • 63
17
votes
4 answers

Azure Cosmos DB Update Pattern

I have recently started using Cosmos DB for a project and I am running into a few design issues. Coming from a SQL background, I understand that related data should be nested within documents on a NoSQL DB. This does mean that documents can become…
Ross
  • 273
  • 3
  • 12
17
votes
1 answer

What is the lifespan of continuation tokens in DocumentDb

I can't find anywhere in the documentation that indicates how long request continuation tokens last for DocumentDb paging support. I therefore suspect it is intentionally undefined. In the real world, how long can I expect a token to last for? I ask…
Sam
  • 946
  • 7
  • 19
17
votes
1 answer

Should my Azure DocumentDB document classes inherit from Microsoft.Azure.Documents.Document?

I'm seeing some weird behavior saving to DocumentDB. I started out saving documents using a plain old class that looked like this: public class Person { public string Name; public int Age; } I saved these documents like this: var person =…
Brian Rak
  • 4,912
  • 6
  • 34
  • 44
17
votes
3 answers

How to delete all the documents in DocumentDB through c# code

I'm using a new database from Microsoft called DocumentDB. Now I want to delete a document by ID, but I cannot figure out, how to do this. Delete operation in DocumentDB requires self-links and they are different from my own ids. However I am…
satish kumar V
  • 1,695
  • 6
  • 33
  • 47
16
votes
1 answer

Test Exceptions in Xunit ()

I am trying to write Xunit test on this method: public async Task> RunSQLQueryAsync(string queryString) { try { //do something } catch (DocumentClientException e) { throw new…
superninja
  • 3,114
  • 7
  • 30
  • 63
16
votes
3 answers

How to cast Azure DocumentDB Document class to my POCO class?

Is there a way to cast the Microsoft.Azure.Documents.Document object to my class type? I've written an Azure Function class, with a CosmosDBTrigger. The trigger receives an array of Microsoft.Azure.Documents.Document. I like having that Document…
Ryan
  • 7,733
  • 10
  • 61
  • 106
16
votes
3 answers

Entity Framework like ORM for Cosmos DB

I am looking for any ORM for Cosmos DB. Most of the client which have been mentioned in samples create a new connection to table when they need i.e. there is no connection pooling policy. It seems creating new connection always as is given in…
Akshat
  • 615
  • 7
  • 18
16
votes
4 answers

Azure Cosmos DB partition key - is primary key acceptable?

Our Azure Cosmos DB collection has gotten large enough to require a partition key. In doing some reading about this, I get the impression that the best partition key is one that provides for even distribution and higher cardinality. This article…
Scotty H
  • 6,432
  • 6
  • 41
  • 94