question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Creating databases with shared throughput is not reliable

See original GitHub issue

I create 4 databases (under the same Cosmos DB account) back to back programmatically using your .NET SDK for Cosmos v3. It seems there is some kind of bug with shared throughput per database.

const int throughput = 800;
await cosmosClient.CreateDatabaseIfNotExistsAsync(databaseId, throughput);

The SDK sometimes creates the first database with 800 shared throughput, but it will ignore this request for subsequent databases. So the other 3 databases will be created with dedicated throughput per container. Now, what’s strange is sometimes the SDK works as expected and creates 4 databases with 800 shared throughput each. I just got slammed with an unexpected bill because of this. I was also able to reproduce this several times.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
bartelinkcommented, Oct 19, 2020

Are you perhaps exceeding the max 25 containers with shared database throughput limit? (IIRC you can still add containers at that point, but only with RUs allocated at the Container level - perhaps your code is specifying the limits at Database and Container level?)

0reactions
msftbot[bot]commented, Dec 15, 2021

Closing due to in-activity, pease feel free to re-open.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introduction to provisioned throughput in Azure Cosmos DB
You can configure shared and dedicated throughput only when creating the database and container. Setting the throughput at the container-level.
Read more >
azure - Deployment of CosmosDB with shared autoscaling ...
If you are creating a new database or container resource you need to pass the throughput in the options for the resource.
Read more >
How can I create a database with provisioned throughput?
I don't see a way to create a database with shared throughput in the new SDK. public virtual Task CreateDatabaseIfNotExistsAsync(string id, ...
Read more >
Things You Need to Know Before Building Apps With ...
Azure Cosmos DB is a scalable no-SQL database. ... Create a database with shared throughput and share it across all collections in that ......
Read more >
Better understanding database throughput and partitioning in ...
We talk about how Azure Cosmos DB determines how many physical ... and also share best practices for scaling throughput, and how to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found