Reputation: 587
There are a lot of articles on the cost of Cosmos DB transactions, but I've never been able to find any detail on the cost of geo-replication. I understand that performing a read with high consistency can generate a high cost query, but is there any impact on writes?
A working example:
What is the total RU cost of writing a 1KB document and having it geo-replicated in this set up? Are charges applied to the non-master regions? Or is there no transaction cost, only storage?
By contrast, what is the cost of writing a 1KB document and having it geo-replicated in this set up?
Upvotes: 4
Views: 1882
Reputation: 141
I'm too new and couldn't comment on your own answer MrPanucci
Believe I've found the answer.
Under the FAQ "How does geo-replication usage (single region writes) show up on my bill?", I found this line:
"Let's also assume that you egress 100GB of data every month from the container in West US to replicate data into East US, North Europe and East Asia. You are billed for egress as per data transfer rates."
It looks like replication is charged at egress rates which can be found here. Looking at the cost breakdown for Cosmos DB I can also see egress being itemised.
I read the link you posted and saw this comment with implies that the geo replication incurs throughput and other costs e.g. storage. So perhaps on top of that, it charges the egress to get the data from one region to the other. It doesn't sound quite right to me to, or its simply expensive to replicate, as that would more than double the cost to do so.
https://azure.microsoft.com/en-us/pricing/details/cosmos-db/
Regional data distribution Azure Cosmos DB supports data replication and distribution across any or all Azure regions for provisioned throughput. You can add and remove regions to your Azure Cosmos DB account at any time. With multi-region distribution enabled, provisioned throughput, consumed storage, and dedicated gateway are billed across every region associated with the account.
Optionally, accounts can be enabled for multi-region writes. When configured this way, accounts are billed at a multi-region rate.
Upvotes: 0
Reputation: 19
You can use the Azure pricing calculator to predict the actual cost. Here is an example. Click here to see the azure pricing
Case1. Manual Throughput:
Single region write the per 100 RU/hour per region cost = US$0.008 (without availability zone)
Multiple regions write the per 100 RU/hour per region cost = US$0.016
-Case 2. Autoscaled Provisioned Throughput:
1. Single region write the per 100 RU/hour per region cost = US$0.012 (without availability zone)
- Let's take your example for 730 hours (30.4167 days)
- Region 1.(write region): 400 * 0.012/100 * 730 = US$35.04
- Region 2.(read region): 400 * 0.012/100 * 730 = US$35.04
- Region 3.(read region): 400 * 0.012/100 * 730 = US$35.04
- Total RU Cost 4. = US$105.12
- Storage Cost 5. US$0.25/1 GB per region
- If you have 100GB of data stored the cost will be: 100 * 0.25 * 3 = US$75.00
2. Multi-region write the per 100 RU/hour per region cost = US$0.016
- Let's take your example for 730 hours (30.4167 days)
- Region 1.(write region): 400 * 0.016/100 * 730 = US$46.72
- Region 2.(write region): 400 * 0.016/100 * 730 = US$46.72
- Region 3.(write region): 400 * 0.016/100 * 730 = US$46.72
- Total RU Cost 4. US$140.16
- Storage Cost 5. US$0.25/1 GB per region
- If you have 100GB of data stored the cost will be: 100 * 0.25 * 3 = US$75.00
Upvotes: 0
Reputation: 71055
When you have a geo-replicated collection, you're effectively duplicating everything in multiple regions, so you have multiple equivalent resource allocation in each of those regions. The resulting cost will multiply along with the number of regions. Specifically:
As for RU/sec: Capacity is allocated for each of your regions. So, if you allocated 400 RU/sec for a given database (or collection), then that RU capacity will also be allocated in your additional regions. And each of your regions would consume the same RU for the same write (e.g. a 2RU write in one region would also incur 2RU in another region, but each write's RUs would come out of the allocated RU/sec in the given region of the write).
As for storage: Each region will have its own storage cost, so 3 regions will cost 3x to store the same data as a single region (ok, that's not precisely accurate, as there could be variations in per-GB costs in different regions of the world; you'd need to look that up).
As for bandwidth: There will be egress from one region to another, for replication purposes.
I won't get into individual pricing details, since that's all documented, but... that's pretty much the tl;dr of geo-replication and pricing.
Upvotes: 2
Reputation: 587
Believe I've found the answer.
Under the FAQ "How does geo-replication usage (single region writes) show up on my bill?", I found this line:
"Let's also assume that you egress 100GB of data every month from the container in West US to replicate data into East US, North Europe and East Asia. You are billed for egress as per data transfer rates."
It looks like replication is charged at egress rates which can be found here. Looking at the cost breakdown for Cosmos DB I can also see egress being itemised.
Upvotes: 1
Reputation: 15571
This depends on the Cosmos DB configuration, for instance if you're using single or multi region writes.
Have a look at Understand your Azure Cosmos DB bill. And more specifically the Billing examples with geo-replication. That should give you enough information.
You can add/remove Azure regions anywhere in the world to your Azure Cosmos database account at any time. The throughput that you have configured for various Azure Cosmos databases and containers will be reserved in each of the Azure regions associated with your Azure Cosmos database account. If the sum of provisioned throughput (RU/sec) configured across all the databases and containers within your Azure Cosmos database account (provisioned per hour) is T and the number of Azure regions associated with your database account is N, then the total provisioned throughput for a given hour, for your Azure Cosmos database account is equal to T x N RU/sec. Provisioned throughput (single write region) costs $0.008/hour per 100 RU/sec and provisioned throughput with multiple writable regions (multi-region writes config) costs $0.016/per hour per 100 RU/sec (see the Pricing page). Whether its single write region, or multiple write regions, Azure Cosmos DB allows you to read data from any region.
Upvotes: 0