AWS Developer DVA-C02 · Development with AWS Services · hard

A developer is designing indexes for an Amazon DynamoDB Orders table whose base primary key is CustomerId (Partition Key) and OrderDate (Sort Key). Which two statements accurately compare a Local Secondary Index (LSI) and a Global Secondary Index (GSI) in DynamoDB? (Select two.)

Published · Last updated · checked before publication — how we verify questions

Options

  • AAn LSI shares the base Partition Key, is created at table creation, and supports strong readsCorrect answer
  • BAn LSI can be added to an existing table anytime and uses a different PK
  • CA GSI can use a different Partition Key, be added anytime, and supports eventual reads onlyCorrect answer
  • DA GSI supports strongly consistent GetItem reads and shares the base table's provisioned WCU quota

Answers: A. An LSI shares the base Partition Key, is created at table creation, and supports strong reads; C. A GSI can use a different Partition Key, be added anytime, and supports eventual reads only

In Amazon DynamoDB: (B) an LSI shares the same Partition Key as the base table (CustomerId) with a different Sort Key, must be created when the table is created, and supports both strongly consistent and eventually consistent reads (A); (C) a GSI can define a completely different Partition Key and Sort Key, can be added or deleted at any time on an existing table, and supports only eventually consistent reads with its own separate RCU/WCU throughput (C).

Why the other options are wrong

  • B. An LSI can be added to an existing table anytime and uses a different PK — Only a GSI can be added to an existing table or use a different Partition Key; LSIs are fixed at table creation.
  • D. A GSI supports strongly consistent GetItem reads and shares the base table's provisioned WCU quota — GSIs support only eventually consistent Query/Scan reads and maintain their own independent RCU/WCU capacity.

All Development with AWS Services questions and the topic overview →

AWS and Amazon Web Services are trademarks of Amazon.com, Inc. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by Amazon Web Services.