QuestionQ26

VerifiedData Store Management

A ride-sharing company keeps records for every ride in an Amazon DynamoDB table. The table contains the following columns and value types:

Question Image

The table presently contains billions of items. It is partitioned by RideID and uses TripStartTime as its sort key. The company wants to use this data to create a personal interface that lets drivers view the rides each driver has completed, based on RideStatus. The solution must retrieve the required data without scanning the full table.

Which solution meets these requirements?

Explanation

A global secondary index with DriverID as its partition key enables an efficient Query for one driver, and RideStatus as its sort key permits restricting that driver's results to Completed. A GSI can use a key schema different from the base table, whereas an LSI must use the base table's partition key (RideID).

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!