skip to Main Content

I’m struggling to understand how the pricing mechanism for RU/s works. Specifically my confusion comes in when the word “first” is used.

I’ve done my research here:https://devblogs.microsoft.com/cosmosdb/build-apps-for-free-with-azure-cosmos-db-free-tier/?WT.mc_id=aaronpowell-blog-aapowell

In the second paragraph it’s mentioned:
“With Azure Cosmos DB Free Tier enabled, you’ll get the first 400 RU/s throughput and 5 GB storage in your account for free each month, for the lifetime of the account.”

So hypothetically speaking if I have an app that does one query and that 1 query evaluates to 1RU. Can I safely assume that

  1. 400 users can execute the query once per second for free?

  2. 500 users can execute the query once per second and I will only be charged for 100RU

  3. If the RU is consistently less than 401 per second, there will be no charge

Please do make mention if there’s any other costing I should be aware of. Ie. Any cosmosDb dependencies, or app service costing

2

Answers


  1. There is some more reading out there you can do:

    azure cosmos db free tier

    pricing examples

    Login or Signup to reply.
  2. You’re not really thinking about RU/sec correctly.

    If you have, say, 400 RU/sec, then that is your allocated # of RU within a one-second window. It has nothing to do with # of users (as I doubt you’re giving end-users direct access to your Cosmos DB instance).

    • in the case of operations only costing 1 RU, then yes, you should be able to execute 400 operations within a 1-second window, without issue (although there is only one type of operation costing 1 RU, and that’s a point-read).
    • in the case you run some type of operation that puts you over the 400RU quota for that 1-second period, that operation completes, but now you’re "in debt" so to speak: you will be throttled until the end of the 1-second period, and likely a bit of time into the next period (or, depending on how deep in RU-debt you went, maybe a few seconds).
    • when you exceed your RU/sec allocation, you do not get charged. In your example, you asked what happens if you try to consume 500 RU in a 1-second window, and asserted you’d be charged for 100 RU. Nope. You’ll just be throttled after exhausting the 400 RU allocation.

    The only way you’ll end up being charged for more RU/sec, is if you increase your RU/sec allocation.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search