All Products
Search
Document Center

Tablestore:What are billing methods and items of Tablestore?

Last Updated:Nov 09, 2023

Tablestore is a pay-as-you-go service. Fees are calculated based on the resources used each billing cycle. No additional fees are charged when you buy instances.

Tablestore provides the following billing items:

  • Storage usage

  • Reserved read/write throughput

  • Additional read/write throughput

  • Internet outbound traffic

Fees are calculated on an hourly basis based on the actual usage of resources when you use Tablestore.

Example 1: Calculate the fees of resources used during one hour

  • Scenario

    During a billing cycle of one hour: Storage usage is 50 GB, Internet outbound traffic usage is 10 GB, and the reserved read/write throughput settings are changed from (1000,1500) to (1200,800) at the 20th minute. A total of 50,000 additional read capacity units (CUs) and 10,000 additional write CUs are used within the billing cycle.

  • Formulas

    Formulas to calculate the fees within the one hour:

    • Storage fees = 50 GB × Unit storage price/GB

    • Traffic fees = 10 GB × Unit price of Internet outbound traffic/GB

    • Fees for reserved read and write CUs:

      • Average reserved read CUs: (1000 × 20 + 1200 × 40)/60 = 1133.3

      • Average reserved write CUs: (1500 × 20 + 800 × 40)/60 = 1033

      • Total fees of reserved read and write CUs: 1133.3 × Unit price of reserved read CU/hour + 1033.3 × Unit price of reserved write CU/hour

    • Total fees of additional read and write CUs: 50000/10000 × Unit price of additional read CU per 10000 CUs + 10000/10000 × Unit price of additional write CU per 10000 CUs

    The total fees consist of the storage fees, traffic fees, fees of reserved read and write CUs, and fees of additional read and write CUs.

    The billing of storage usage and reserved read and write CUs is accurate to the minute. The average storage usage and reserved read and write CUs apply when the system calculates fees at the end of a billing cycle. The billing of additional read and write CUs is accurate to the second. Fees are calculated based on used CUs in each second.

    Example: Within the first 20 minutes, the reserved read throughput is set to 1000 CUs. During one second, 2,100 CUs are consumed. Additional read CUs are calculated based on the following formula: Additional read CUs = 2100 - 1000. This way, additional read CUs are 1100.

Example 2: Calculate the fees of resources used within one day

  • Scenario 1

    The following section describes the billing methods that are used when you buy resources in a traditional way.

    image.png

    The preceding line chart simulates the access to an application in one day. Assume that the visits generated by read and write requests to the application are the same for the convenience of illustration. To ensure that sufficient resources are available for the application to provide read and write services during peak hours, you must buy resources based on your business at peak hours. In Tablestore, you can buy 200 CUs for each of reserved read throughput and write throughput.

    Formulas

    Total fees = 200 × Unit price of reserved read CU/hour × 24 + 200 × Unit price of reserved write CU/hour × 24 + Storage fees within 24 hours + Traffic usage within 24 hours × Unit price of Internet outbound traffic.

    In other words, total fees = 4800 × Unit price of reserved read CU/hour + 4800 × Unit price of reserved write CU/hour + Storage fees within 24 hours + Internet outbound traffic within 24 hours.

    Tablestore provides the operation to adjust the settings of reserved read/write throughput. You can call the operation to adjust the reserved read and write CUs for each table anytime. The adjustment takes effect within one minute and does not affect business.

    You can use this method and increase reserved CUs to meet business requirements at peak hours and decrease the reserved CUs for off peak hours to minimize costs.

  • Scenario 2

    Example: Specify different reserved read/write CUs based on different periods within a day.

    image.png

    Read and write CUs consumed within the 24 hours:

    • 00:00:00–05:00:00: The reserved read throughput is set to 30 CUs. The reserved write throughput is set to 30 CUs. Within the five hours, the reserved read CUs are 100,000. The reserved write CUs are 100,000.

    • 05:00:00–10:00:00: Access to the application decreases. Decrease the reserved read CUs to 20 and reserved write CUs to 20. Within the five hours, additional read CUs are 5,000. Additional write CUs are 5,000.

    • 10:00:00–12:00:00: Access to the application increases. The reserved read CUs are increased to 45 and the write CUs are increased to 45. Within the two hours, additional read CUs are 10,000. Additional write CUs are 10,000.

    • 12:00:00–18:00:00: business peak hours. The reserved read CUs are increased to 180 and the reserved write CUs are increased to 180. Within the six hours, additional read CUs are 30,000. Additional write CUs are 30,000.

    • 18:00:00–24:00:00: business off peak hours. Decrease the reserved read CUs to 20 and write CUs to 20. Within the six hours, additional read CUs are 50,000. Additional write CUs are 50,000.

    Formulas

    To facilitate calculation, assume that consumed read CUs are the same as consumed write CUs and reserved read CUs are the same as reserved write CUs. The fees generated in a day are calculated as follows:

    • Fees of consumed read CUs:

      Fees of consumed read CUs = (30 × 5 hours + 20 × 5 hours + 45 × 2 hours + 180 × 6 hours + 20 × 6 hours) × Unit price of reserved read CU/hour + (100000 + 5000+ 10000 + 30000 + 50000) × Unit price of additional read CU/hour

      In other words, fees of consumed read CUs = 1540 × Unit price of reserved read CU/hour + 195000 × Unit price of additional read CU/hour.

    • Fees of consumed write CUs:

      Fees of consumed write CUs = (30 × 5 hours + 20 × 5 hours + 45 × 2 hours + 180 × 6 hours + 20 × 6 hours) × Unit price of reserved write CU/hour + (100000 + 5000 + 10000 + 30000 + 50000) × Unit price of additional write CU/hour

      In other words, fees of consumed write CUs= 1540 × Unit price of reserved write CU/hour + 195000 × Unit price of additional write CU/hour.

    Compared with the method used to buy resources in Scenario 1, the method used in Scenario 2 is more cost-effective:

    Saved fees = 4800 × Unit price of reserved read CU/hour + 4800 × Unit price of reserved write CU/hour - 1540 × Unit price of reserved read CU/hour - 19.5 × Unit price of additional read CU per 10000 CUs - 1540 × Unit price of reserved write CU/hour - 19.5 × Unit price of additional write CU per 10000 CUs

References

  • The unit prices of reserved read and write CUs are higher than those of additional read and write CUs. We recommend that you adjust the reserved read and write CUs to minimize costs.

  • You can use Tablestore SDK to set the reserved read and write CUs to relatively low values to minimize costs.