0
0
DynamoDBquery~10 mins

Cost estimation for access patterns in DynamoDB - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the read capacity units for a DynamoDB table.

DynamoDB
ProvisionedThroughput={"ReadCapacityUnits": [1], "WriteCapacityUnits": 5}
Drag options to blanks, or click blank then click option'
A0
B10
C-5
D"five"
Attempts:
3 left
💡 Hint
Common Mistakes
Using zero or negative numbers for capacity units.
Using strings instead of numbers.
2fill in blank
medium

Complete the code to calculate the total cost for 1000 read requests with a cost of $0.00013 per read unit.

DynamoDB
total_cost = 1000 * [1]
Drag options to blanks, or click blank then click option'
A0.013
B0.0013
C0.00013
D0.000013
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong cost value like 0.0013 instead of 0.00013.
Confusing cost per write with cost per read.
3fill in blank
hard

Fix the error in the code to correctly estimate the write capacity units needed for 500 writes per second with each write consuming 2 WCUs.

DynamoDB
required_wcu = 500 [1] 2
Drag options to blanks, or click blank then click option'
A/
B-
C+
D*
Attempts:
3 left
💡 Hint
Common Mistakes
Using addition instead of multiplication.
Dividing instead of multiplying.
4fill in blank
hard

Fill both blanks to create a DynamoDB query that filters items with attribute 'status' equal to 'active' and limits results to 10.

DynamoDB
response = table.query(KeyConditionExpression=[1], Limit=[2])
Drag options to blanks, or click blank then click option'
AKey('status').eq('active')
BKey('status').ne('active')
C5
D10
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ne' (not equal) instead of 'eq' (equal).
Setting limit to a wrong number.
5fill in blank
hard

Fill all three blanks to create a DynamoDB update expression that sets 'score' to 100 only if the current 'score' is less than 100.

DynamoDB
response = table.update_item(Key=[1], UpdateExpression=[2], ConditionExpression=[3])
Drag options to blanks, or click blank then click option'
A{"id": "123"}
B"SET score = :val"
C"score < :val"
D{"user": "123"}
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong key attribute name.
Missing 'SET' in update expression.
Using wrong condition expression.