0
0
DynamoDBquery~30 mins

On-demand vs provisioned cost comparison in DynamoDB - Hands-On Comparison

Choose your learning style9 modes available
On-demand vs Provisioned Cost Comparison in DynamoDB
📖 Scenario: You are managing a DynamoDB table for a small online store. You want to compare the monthly costs between using on-demand capacity mode and provisioned capacity mode based on your expected read and write requests.
🎯 Goal: Build a simple DynamoDB cost comparison by creating a data structure for request counts, setting capacity units, calculating costs for both on-demand and provisioned modes, and then outputting the cost comparison.
📋 What You'll Learn
Create a dictionary called monthly_requests with exact keys 'read' and 'write' and values 1000000 and 500000 respectively
Create variables read_capacity_units and write_capacity_units with values 50 and 25 respectively
Calculate provisioned_cost using the formula: (read_capacity_units * 0.00013 + write_capacity_units * 0.00065) * 730
Calculate on_demand_cost using the formula: (monthly_requests['read'] * 0.25 / 1000000 + monthly_requests['write'] * 1.25 / 1000000)
Create a dictionary called cost_comparison with keys 'provisioned' and 'on_demand' and their respective cost values
💡 Why This Matters
🌍 Real World
This project helps you understand how to estimate and compare costs for different DynamoDB capacity modes, which is important for budgeting and optimizing cloud expenses.
💼 Career
Database administrators and cloud engineers often need to analyze cost trade-offs between on-demand and provisioned capacity to make informed decisions for scalable and cost-efficient database management.
Progress0 / 4 steps
1
Create monthly request counts
Create a dictionary called monthly_requests with keys 'read' and 'write' and values 1000000 and 500000 respectively.
DynamoDB
Need a hint?

Use curly braces to create a dictionary with the exact keys and values.

2
Set provisioned capacity units
Create two variables called read_capacity_units and write_capacity_units and set them to 50 and 25 respectively.
DynamoDB
Need a hint?

Assign the numbers 50 and 25 to the variables exactly as named.

3
Calculate provisioned and on-demand costs
Calculate provisioned_cost using the formula (read_capacity_units * 0.00013 + write_capacity_units * 0.00065) * 730 and calculate on_demand_cost using the formula (monthly_requests['read'] * 0.25 / 1000000 + monthly_requests['write'] * 1.25 / 1000000).
DynamoDB
Need a hint?

Use the exact variable names and formulas given to calculate costs.

4
Create cost comparison dictionary
Create a dictionary called cost_comparison with keys 'provisioned' and 'on_demand' and assign the variables provisioned_cost and on_demand_cost as their values.
DynamoDB
Need a hint?

Use curly braces to create the dictionary with the exact keys and assign the cost variables as values.