You have a DynamoDB table in On-demand mode. It receives 1 billion read requests and 500 million write requests per month. Reads cost $1.25 per million and writes cost $1.25 per million. What is the total monthly cost?
Calculate cost by multiplying requests by cost per million, then add reads and writes.
Reads: (1,000,000,000 / 1,000,000) * $1.25 = 1,000 * $1.25 = $1,250; Writes: (500,000,000 / 1,000,000) * $1.25 = 500 * $1.25 = $625; Total = $1,250 + $625 = $1,875.
A DynamoDB table is in provisioned mode with 1,500 read capacity units (RCUs) and 300 write capacity units (WCUs). Reads cost $0.00013 per RCU-hour and writes cost $0.00065 per WCU-hour. Calculate the monthly cost assuming 30 days.
Calculate hourly cost for reads and writes, then multiply by hours in 30 days (720 hours).
Reads: 1,500 * $0.00013 = $0.195/hr; Writes: 300 * $0.00065 = $0.195/hr; Total/hr = $0.39; Monthly = $0.39 * 720 = $280.80.
Which statement best describes the main cost difference between DynamoDB On-demand and Provisioned capacity modes?
Think about how billing works for each mode.
On-demand mode bills you for each read/write request you make. Provisioned mode bills you for the capacity units you reserve, whether you use them or not.
Given this SQL-like pseudocode to calculate monthly cost for provisioned mode:SELECT (RCU * 0.00013 + WCU * 0.00065) * 720 AS monthly_cost FROM table_capacity;
What is the main issue with this query?
SELECT (RCU * 0.00013 + WCU * 0.00065) * 720 AS monthly_cost FROM table_capacity;
Consider if the query aggregates multiple rows or not.
If table_capacity has multiple rows, the query will return multiple monthly_cost values instead of a total. A GROUP BY or aggregation is needed to sum costs.
You manage a DynamoDB table with highly variable traffic: low usage at night and high during the day. Which strategy best optimizes cost while ensuring performance?
Think about balancing cost and performance with changing traffic.
Provisioned mode with auto scaling adjusts capacity based on traffic, saving cost during low usage and providing capacity during peaks.