0
0
DynamoDBquery~10 mins

Transaction limits 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 maximum number of items allowed in a DynamoDB transaction.

DynamoDB
max_items = [1]
Drag options to blanks, or click blank then click option'
A50
B100
C10
D25
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a number higher than 100, which exceeds DynamoDB transaction limits.
Choosing a number too low, which underestimates the allowed transaction size.
2fill in blank
medium

Complete the code to set the maximum size in bytes for a DynamoDB transaction request.

DynamoDB
max_transaction_size_bytes = [1]
Drag options to blanks, or click blank then click option'
A5000000
B10000000
C4000000
D2500000
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 10,000,000 bytes which is too large.
Choosing 2,500,000 bytes which is too small.
3fill in blank
hard

Fix the error in the code to correctly check if the transaction size exceeds the limit.

DynamoDB
if transaction_size > [1]:
    raise Exception('Transaction size limit exceeded')
Drag options to blanks, or click blank then click option'
A4000000
B5000000
C10000000
D2500000
Attempts:
3 left
💡 Hint
Common Mistakes
Using a size larger than the limit, which won't catch the error.
Using a size smaller than the limit, which may cause false errors.
4fill in blank
hard

Fill the blank to create a condition that checks if the number of items in a transaction is within limits.

DynamoDB
if len(transaction_items) [1] 100:
    process_transaction()
Drag options to blanks, or click blank then click option'
A>
B<
C==
D<=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' which would allow too many items.
Using '==' which is too strict.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that filters transaction items by size and count limits.

DynamoDB
valid_items = {item['id']: item for item in transaction_items if item['size'] [1] 4000000 and len(transaction_items) [2] 100 and item['status'] [3] 'pending'}
Drag options to blanks, or click blank then click option'
A<=
B<
C==
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' for status which would exclude 'pending' items.
Using '>' which would allow too large sizes or too many items.