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 respectivelyCreate variables
read_capacity_units and write_capacity_units with values 50 and 25 respectivelyCalculate
provisioned_cost using the formula: (read_capacity_units * 0.00013 + write_capacity_units * 0.00065) * 730Calculate
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