0
0
DynamoDBquery~10 mins

Index capacity and cost 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 type of index when creating a DynamoDB table.

DynamoDB
TableName: 'Music',
KeySchema: [
  { AttributeName: 'Artist', KeyType: 'HASH' },
  { AttributeName: 'SongTitle', KeyType: 'RANGE' }
],
GlobalSecondaryIndexes: [{
  IndexName: 'GenreIndex',
  KeySchema: [
    { AttributeName: 'Genre', KeyType: 'HASH' }
  ],
  Projection: { ProjectionType: 'ALL' },
  ProvisionedThroughput: {
    ReadCapacityUnits: 5,
    WriteCapacityUnits: 5
  },
  IndexType: '[1]'
}]
Drag options to blanks, or click blank then click option'
AGLOBAL
BPRIMARY
CSECONDARY
DLOCAL
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing local and global index types.
Using PRIMARY as an index type which is invalid.
2fill in blank
medium

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

DynamoDB
ProvisionedThroughput: {
  ReadCapacityUnits: [1],
  WriteCapacityUnits: 10
}
Drag options to blanks, or click blank then click option'
A-1
B0
Cnull
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Setting capacity units to zero or negative values.
Using null instead of a number.
3fill in blank
hard

Fix the error in the code by choosing the correct attribute to project in the index.

DynamoDB
Projection: {
  ProjectionType: '[1]'
}
Drag options to blanks, or click blank then click option'
AALL
BKEYS_ONLY
CINCLUDE
DNONE
Attempts:
3 left
💡 Hint
Common Mistakes
Using NONE which is invalid.
Confusing INCLUDE with ALL.
4fill in blank
hard

Fill both blanks to correctly define the provisioned throughput for a global secondary index.

DynamoDB
ProvisionedThroughput: {
  ReadCapacityUnits: [1],
  WriteCapacityUnits: [2]
}
Drag options to blanks, or click blank then click option'
A10
B5
C20
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Setting capacity units to zero.
Using the same value for both read and write units without reason.
5fill in blank
hard

Fill all three blanks to create a dictionary that maps index names to their read capacity units, filtering only indexes with read capacity greater than 5.

DynamoDB
index_read_capacity = {index['IndexName']: index['ProvisionedThroughput']['ReadCapacityUnits'] for index in indexes if index['ProvisionedThroughput']['ReadCapacityUnits'] [1] [2]

filtered_index_read_capacity = {k: v for k, v in index_read_capacity.items() if v [3] 5}
Drag options to blanks, or click blank then click option'
A>
B10
C>=
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' causing wrong filtering.
Using '>=' when only '>' is needed.