Challenge - 5 Problems
DynamoDB Projection Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
What does the KEYS_ONLY projection type include in a DynamoDB index?
In DynamoDB, when you create a secondary index with the KEYS_ONLY projection type, which attributes are included in the index?
Attempts:
2 left
💡 Hint
Think about what minimal data is needed to uniquely identify items in the index.
✗ Incorrect
The KEYS_ONLY projection type includes only the primary key attributes of the base table and the index key attributes. This keeps the index small and efficient.
❓ query_result
intermediate1:30remaining
Which projection type returns all attributes in a DynamoDB index query?
You query a DynamoDB secondary index with the projection type set to ALL. What attributes will the query return?
Attempts:
2 left
💡 Hint
ALL means everything is included.
✗ Incorrect
The ALL projection type includes all attributes from the base table in the index, so queries return the full item.
📝 Syntax
advanced2:00remaining
Identify the correct syntax to specify an INCLUDE projection with attributes in a DynamoDB index creation.
Which of the following JSON snippets correctly defines an INCLUDE projection with attributes 'Name' and 'Age' for a DynamoDB secondary index?
Attempts:
2 left
💡 Hint
Check the exact property names required by DynamoDB for projections.
✗ Incorrect
The correct syntax requires the 'Projection' object with 'ProjectionType' set to 'INCLUDE' and the 'NonKeyAttributes' array listing the attributes.
❓ optimization
advanced2:00remaining
Choosing the best projection type for a read-heavy application with frequent queries on a few attributes
You have a DynamoDB table with many attributes, but your application mostly queries a few specific attributes along with the keys. Which projection type should you choose for the secondary index to optimize read performance and storage?
Attempts:
2 left
💡 Hint
Think about balancing storage size and query efficiency for specific attributes.
✗ Incorrect
INCLUDE projection lets you specify only the needed non-key attributes, reducing index size and improving query speed for those attributes.
🔧 Debug
expert2:30remaining
Why does a query on a KEYS_ONLY projected index fail to return a non-key attribute?
You created a secondary index with KEYS_ONLY projection and query it expecting to get a non-key attribute 'Email'. The query returns no 'Email' attribute. Why?
Attempts:
2 left
💡 Hint
Recall what KEYS_ONLY projection includes in the index.
✗ Incorrect
KEYS_ONLY projection includes only primary key attributes and index keys, so non-key attributes like 'Email' are not stored in the index and cannot be returned by queries on it.