Azure Cosmos DB Billing Components and Request Units

 
Billing Model
 
Two components: Consumed Storage + Provisioned Throughput
 
 
 
 
 
 
 
 
You are billed on consumed storage and provisioned throughput
 
Containers in a database can share throughput
 
* pricing may vary by region; for up-to-date pricing, see: 
https://azure.microsoft.com/pricing/details/cosmos-db/
 
Request Units
 
R
e
q
u
e
s
t
 
U
n
i
t
s
 
(
R
U
s
)
 
i
s
 
a
 
r
a
t
e
-
b
a
s
e
d
 
c
u
r
r
e
n
c
y
 
 
e
.
g
.
 
1
0
0
0
 
R
U
/
s
e
c
o
n
d
 
 
 
 
Abstracts physical resources for performing requests
 
Request Units
 
Each request consumes # of RU
Approx. 1 RU =  1 read of 1 KB document
Approx. 5 RU = 1 write of a 1KB document
Query: Depends on query & documents involved
GET
POST
PUT
Query
=
=
=
=
Request Units- Provisioned throughput
P
r
o
v
i
s
i
o
n
e
d
 
i
n
 
t
e
r
m
s
 
o
f
 
R
U
/
s
e
c
 
 
e
.
g
.
 
1
0
0
0
 
R
U
/
s
B
i
l
l
e
d
 
f
o
r
 
h
i
g
h
e
s
t
 
R
U
/
s
 
i
n
 
1
 
h
o
u
r
Easy to increase and decrease on demand
Rate limiting based on amount of throughput provisioned
Background processes like TTL expiration, index transformations
scheduled when quiescent
Min RU/sec
Max
RU/sec
Incoming Requests
No rate limiting,
process background
operations
Rate limiting –
SDK retry
No rate limiting
Estimating Required RU’s
 
Autopilot Mode for Throughput
 
While it is easy to estimate and scale throughput in Azure Cosmos DB, some
customers prefer if scaling is managed automatically
 
When enabling 
autopilot
 
mode 
on Cosmos containers, customers only need to
specify a maximum throughput (Tmax) not be exceeded.
Containers will scale instantly and automatically based on workload needs
Containers will scale between 0.1*Tmax and Tmax
 
Autopilot Mode vs Manually Provisioned
Throughput
 
Azure Cosmos containers that are configured in autopilot mode have the
following benefits:
Simple 
– There is no need to invest time in manually scaling throughput or writing
code to automatically scale throughput
Reliable – 
Autopilot scaling is fully managed by Microsoft. There is no disruption to
client connections, applications, or impact to SLA’s.
No rate-limiting of operations 
– Rate limiting (throttled requests) will not happen if
throughput consumed is within the max throughput chosen for autopilot mode.
Autopilot mode pricing:
Single-region write accounts- 
Cost for provisioned RU’s is 50% higher
Multi-region write accounts- 
Cost for provisioned RU’s is identical to cost of manually
provisioned throughput RU’s
 
 
 
 
Database Level Throughput
 
You can provision throughput at the database level instead of individually for
each container
 
Throughput is 
shared
 among each designated container within the database
 
You can provision dedicated throughput for some containers
 
 
 
Database vs Container Level Throughput
 
In general, 
container level throughput 
is a good choice. This leads to
predictable performance since each container is guaranteed its provisioned
RU’s.
 
Choosing Database Level Throughput can also be a good option if:
 
You are migrating many containers in a lift and shift migration (from Table Storage,
MongoDB, or Cassandra) and do not know how much throughput to set for each one
You have containers that are timeshared
Multitenant applications where each user is represented by a separate container
Pricing Example – Do this exercise to ballpark cost + RU/s required
 
S
t
o
r
a
g
e
 
C
o
s
t
 
T
h
r
o
u
g
h
p
u
t
 
C
o
s
t
 
T
o
t
a
l
 
M
o
n
t
h
l
y
 
C
o
s
t
 
[Total Monthly Cost] = [Monthly Cost for Storage] + [Monthly Cost for Throughput]
                                      =   $25                                       +   $54
                                      =   $79 per month
* pricing may vary by region; for up-to-date pricing, see: 
https://azure.microsoft.com/pricing/details/cosmos-db/
 
COSMOS DB RESERVED
CAPACITY CAN PROVIDE
UP TO 65% SAVINGS
 
S
a
v
e
 
u
p
 
t
o
 
6
5
%
 
w
i
t
h
 
A
z
u
r
e
 
C
o
s
m
o
s
 
D
B
r
e
s
e
r
v
e
d
 
c
a
p
a
c
i
t
y
 
p
r
i
c
i
n
g
 
+
 
U
p
 
t
o
 
6
5
%
s
a
v
i
n
g
s
 
C
u
s
t
o
m
e
r
c
o
s
t
 
B
e
s
t
 
v
a
l
u
e
 
f
o
r
 
t
h
e
p
r
i
c
e
 
Best elasticity for the price
 
Total Time To Live (TTL) is
free
 
No need to segment
into read and write workloads –
w/ unified 
and
 normalized
throughput currency - RUs
 
Saturation of provisioned
capacity via 
sub-core
multiplexing
 
Deep integration w/ Azure
Networking
 
Enterprise-ready (security,
compliance, encryption) at
no additional cost
 
Azure Cosmos DB
Reserved Capacity
 
Azure Cosmos DB Reserved Capacity helps you
save money by pre-paying for one-year or three-
years of Cosmos DB capacity allowing you to get
a discount on the Cosmos DB resources, e.g.,
databases, containers
(tables/collections/graphs) you use.
Azure Cosmos DB Reserved Capacity can
significantly reduce your Cosmos DB costs—up
to 65 percent on regular prices–with one-year or
three-year upfront commitment.
Reserved Capacity provides a billing discount
and does not affect the runtime state of your
Cosmos DB resources.
 
E
f
f
e
c
t
i
v
e
 
D
i
s
c
o
u
n
t
s
 
M
a
r
g
i
n
a
l
 
D
i
s
c
o
u
n
t
s
 
Cosmos DB Provisioned Throughput FAQ
 
I
s
 
m
y
 
b
i
l
l
 
d
e
p
e
n
d
e
n
t
 
o
n
 
h
o
w
 
m
u
c
h
 
p
r
o
v
i
s
i
o
n
e
d
 
t
h
r
o
u
g
h
p
u
t
 
I
 
c
o
n
s
u
m
e
?
 
No, your bill is based on provisioned throughput, not consumed throughput. Therefore, your bill is predictable. If you provision, say,
1000 RU’s you know you will be billed for exactly that amount.
 
I
s
 
i
t
 
p
o
s
s
i
b
l
e
 
t
o
 
s
c
a
l
e
 
p
r
o
v
i
s
i
o
n
e
d
 
t
h
r
o
u
g
h
p
u
t
?
 
Yes, it is easily to scale provisioned throughput through the portal, Azure CLI, or sdk’s. You are only billed for the peak throughput
that you provision during each hour.
 
H
o
w
 
d
o
e
s
 
C
o
s
m
o
s
 
D
B
 
g
e
o
-
r
e
p
l
i
c
a
t
i
o
n
 
a
f
f
e
c
t
 
p
r
i
c
i
n
g
?
 
When you geo-replicate Cosmos DB accounts to additional regions, we have a full copy of your data (storage as well as RU’s) in
each region. Therefore, you are billed for the total storage and provisioned RU’s across all regions. More information is here:
https://azure.microsoft.com/en-us/pricing/details/cosmos-db/
 
I
 
h
a
v
e
 
a
 
l
o
t
 
o
f
 
c
o
l
l
e
c
t
i
o
n
s
 
a
n
d
 
i
t
s
 
v
e
r
y
 
e
x
p
e
n
s
i
v
e
.
 
H
o
w
 
c
a
n
 
I
 
r
e
d
u
c
e
 
c
o
s
t
s
?
 
Cosmos DB gives you options to set throughput at either the database or container/collection level. You can simply provision
throughput for a database and have this throughput shared among all selected collections within the database
 
Slide Note
Embed
Share

Azure Cosmos DB billing model consists of two main components - Consumed Storage and Provisioned Throughput. You are billed based on the storage consumption and provisioned throughput. Request Units (RUs) abstract physical resources for performing requests, with specific RU costs for different types of operations. Estimating required RUs involves identifying query patterns and access frequencies. Autopilot mode allows for automatic scaling of throughput based on workload needs.

  • Azure Cosmos DB
  • Billing
  • Request Units
  • Provisioned Throughput
  • Autopilot

Uploaded on Jul 30, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Request Units & Billing

  2. Billing Model Two components: Consumed Storage + Provisioned Throughput Unit Price (for most Azure regions) SSD Storage (per GB) $0.25 per month Provisioned Throughput (single region writes) $0.008/hour per 100 RU/s Provisioned Throughput (multi-region writes) $0.016/hour per 100 multi-region write RU/s You are billed on consumed storage and provisioned throughput Containers in a database can share throughput * pricing may vary by region; for up-to-date pricing, see: https://azure.microsoft.com/pricing/details/cosmos-db/

  3. Request Units Request Units (RUs) is a rate-based currency e.g. 1000 RU/second % Memory % CPU % IOPS Abstracts physical resources for performing requests

  4. Request Units = GET Each request consumes # of RU Approx. 1 RU = 1 read of 1 KB document = POST Approx. 5 RU = 1 write of a 1KB document = Query: Depends on query & documents involved PUT = Query

  5. Request Units- Provisioned throughput Provisioned in terms of RU/sec e.g. 1000 RU/s Billed for highest RU/s in 1 hour Incoming Requests Rate limiting SDK retry Easy to increase and decrease on demand Max RU/sec No rate limiting Rate limiting based on amount of throughput provisioned Min RU/sec Background processes like TTL expiration, index transformations scheduled when quiescent No rate limiting, process background operations

  6. Estimating Required RUs Operation Type Write Single Document Top Query #1 Top Query #2 Top Query #3 Total RU/s Total RU/s # Requests per sec # RU's per Request RU's Needed 10 100 100 100 10,000 700 200 100 100,000 70,000 20,000 10,000 200,000 RU/s Guidance: Identify query & access patterns e.g. top 5 queries, or # reads/writes per second Use Request Charge property from SDK + sample document to see # RU / operation POC / Load test -> Scale up, and scale down

  7. Autopilot Mode for Throughput While it is easy to estimate and scale throughput in Azure Cosmos DB, some customers prefer if scaling is managed automatically When enabling autopilotmode on Cosmos containers, customers only need to specify a maximum throughput (Tmax) not be exceeded. Containers will scale instantly and automatically based on workload needs Containers will scale between 0.1*Tmax and Tmax

  8. Autopilot Mode vs Manually Provisioned Throughput Azure Cosmos containers that are configured in autopilot mode have the following benefits: Simple There is no need to invest time in manually scaling throughput or writing code to automatically scale throughput Reliable Autopilot scaling is fully managed by Microsoft. There is no disruption to client connections, applications, or impact to SLA s. No rate-limiting of operations Rate limiting (throttled requests) will not happen if throughput consumed is within the max throughput chosen for autopilot mode. Autopilot mode pricing: Single-region write accounts- Cost for provisioned RU s is 50% higher Multi-region write accounts- Cost for provisioned RU s is identical to cost of manually provisioned throughput RU s

  9. Database Level Throughput You can provision throughput at the database level instead of individually for each container Throughput is shared among each designated container within the database You can provision dedicated throughput for some containers

  10. Database vs Container Level Throughput In general, container level throughput is a good choice. This leads to predictable performance since each container is guaranteed its provisioned RU s. Choosing Database Level Throughput can also be a good option if: You are migrating many containers in a lift and shift migration (from Table Storage, MongoDB, or Cassandra) and do not know how much throughput to set for each one You have containers that are timeshared Multitenant applications where each user is represented by a separate container

  11. Pricing Example Do this exercise to ballpark cost + RU/s required Storage Cost Avg Record Size (KB) Number of Records Total Storage (GB) Monthly Cost per GB Expected Monthly Cost for Storage 1 100,000,000 100 $0.25 $25.00 Throughput Cost Operation Type Create Read Number of Requests per sec Avg RU's per Request RU's Needed 100 400 5 1 500 400 Total RU/sec Hourly Cost per 100 RU/sec Monthly Cost per 100 RU/sec Expected Monthly Cost for Throughput 900 $0.008 $6.00 $54.00 Total Monthly Cost [Total Monthly Cost] = [Monthly Cost for Storage] + [Monthly Cost for Throughput] = $25 + $54 = $79 per month * pricing may vary by region; for up-to-date pricing, see: https://azure.microsoft.com/pricing/details/cosmos-db/

  12. Save up to 65% with Azure Cosmos DB reserved capacity pricing COSMOS DB RESERVED CAPACITY CAN PROVIDE UP TO 65% SAVINGS + Up to 65% savings Customer cost Best value for the price Saturation of provisioned capacity via sub-core multiplexing Best elasticity for the price Deep integration w/ Azure Networking No need to segment into read and write workloads w/ unified and normalized throughput currency - RUs Enterprise-ready (security, compliance, encryption) at no additional cost Total Time To Live (TTL) is free

  13. Marginal Discounts Azure Cosmos DB Reserved Capacity 1 Year 3 Year Throughput Single Region Writes Multiple Regions Writes Single Region Writes Multiple Regions Writes First 100K RU/s 20% 25% 30% 35% Azure Cosmos DB Reserved Capacity helps you save money by pre-paying for one-year or three- years of Cosmos DB capacity allowing you to get a discount on the Cosmos DB resources, e.g., databases, containers (tables/collections/graphs) you use. Next 400K RU/s 25% 30% 35% 40% Next 2.5M RU/s 30% 35% 45% 50% Over 3M RU/s 45% 50% 60% 65% Azure Cosmos DB Reserved Capacity can significantly reduce your Cosmos DB costs up to 65 percent on regular prices with one-year or three-year upfront commitment. Effective Discounts Amount 1 Year single region writes 20.00% 3 Year - single region writes 30.00% 1 Year - multiple region writes 25.00% 3 Year - multiple region writes 35.00% 100,000 Reserved Capacity provides a billing discount and does not affect the runtime state of your Cosmos DB resources. 500,000 24.00% 34.00% 29.00% 39.00% 1,000,000 27.00% 39.50% 32.00% 44.50% 2,000,000 28.50% 42.25% 33.50% 47.25% 3,000,000 29.00% 43.17% 34.00% 48.17% 5,000,000 35.40% 49.90% 40.40% 54.90% 10,000,000 40.20% 54.95% 45.20% 59.95% 20,000,000 42.60% 57.48% 47.60% 62.48% 30,000,000 43.40% 58.32% 48.40% 63.32%

Related


More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#