How to use AWS DynamoDB to save money?

DynamoDB has two charging methods: "Preset capacity" and "On-demand capacity". In actual use, it is often tangled that way is more economical. We calculate in the following way. Let you know what Dynamodb spends.

Scenario setting: preset capacity, statistics according to 10 WCU and 50 RCU, can be multiplied by 10 times to increase according to the actual situation.

1. DynamoDB pricing

https://www.amazonaws.cn/dynamodb/pricing/

1.1. Amazon DynamoDB provisioned capacity-China (Beijing) and China (Ningxia) regions

 You pay a uniform hourly rate based on the reserved capacity:

  • Write throughput: Write capacity per 10 units ¥ 0.058
  • Read throughput: Read capacity per 50 units ¥ 0.058


1.2. Amazon DynamoDB on-demand capacity-China (Beijing) and China (Ningxia) regions

For each read or write request performed, you are charged a fixed price:

  • Write request: ¥11.1538 per 1,000,000 write request units  (single request ¥0.0000111538)
  • Read request: ¥2.2308 per 1000000 read request unit (single request ¥0.0000022308)

 

2. How to choose, through calculation:

2.1. WCU preset capacity VS on-demand capacity

Preset capacity, equivalent to providing 10x3600s=36000WCU per hour

On-demand capacity calculation, the cost of one hour of preset capacity is divided by the cost of a single on-demand request, 0.058/0.0000111538=5200WCU/hour, that is, if WCU exceeds this value in each hour, the preset capacity is more cost-effective Up.

In addition, consider that the preset capacity will be throttled by 10 WCU at a certain point in time.

2.2. RCU preset capacity VS on-demand capacity

Preset capacity, equivalent to 50x3600s=180,000WCU per hour

On-demand capacity calculation, the cost of one hour of preset capacity is divided by the cost of a single on-demand request, 0.058/0.0000022308=25,999 WCU/hour, that is, if WCU exceeds this value in each hour, the preset capacity is even more It's a bargain.

Also need to consider that the preset capacity will be throttled by 50 RCU at a certain point in time.

  3. Reserved capacity RI

3.1. Amazon DynamoDB reserved capacity - China (Beijing) and China (Ningxia) regions


1 year period

Monthly commitment

Prepaid

per hour

100 write capacity units

¥ 1300

¥ 0.120

100 read capacity units

¥ 280

¥ 0.022

 Note: Minimum purchase of 100 WCU/RCU

 A one-year period provides a 53% discount for preset throughput.

Through the above introduction, I believe you already know what kind of business scenario, "pre-set capacity" and "on-demand capacity" two payment methods, which is more suitable for you!

 

 


Guess you like

Origin blog.51cto.com/hsbxxl/2572140