nerdexam
Amazon

DEA-C01 · Question #267

A ride-sharing company stores records for all rides in an Amazon DynamoDB table. The table includes the following columns and types of values: The table currently contains billions of items. The…

The correct answer is C. Create a global secondary index (GSI) that uses DriverID as the partition key and RideStatus as. To let drivers efficiently query only their completed rides, you need a global secondary index (GSI) with DriverID as the partition key (so queries can be targeted per driver) and RideStatus as the sort key (so you can query for “Completed” rides without scanning the full…

Data Store Management

Question

A ride-sharing company stores records for all rides in an Amazon DynamoDB table. The table includes the following columns and types of values:

The table currently contains billions of items. The table is partitioned by RideID and uses TripStartTime as the sort key. The company wants to use the data to build a personal interface to give drivers the ability to view the rides that each driver has completed, based on RideStatus. The solution must access the necessary data without scanning the entire table. Which solution will meet these requirements?

Exhibit

DEA-C01 question #267 exhibit

Options

  • ACreate a local secondary index (LSI) on DriverID.
  • BCreate a global secondary index (GSI) that uses RiderID as the partition key and RideStatus as
  • CCreate a global secondary index (GSI) that uses DriverID as the partition key and RideStatus as
  • DCreate a filter expression that uses RiderID and RideStatus.

How the community answered

(26 responses)
  • A
    8% (2)
  • B
    4% (1)
  • C
    85% (22)
  • D
    4% (1)

Explanation

To let drivers efficiently query only their completed rides, you need a global secondary index (GSI) with DriverID as the partition key (so queries can be targeted per driver) and RideStatus as the sort key (so you can query for “Completed” rides without scanning the full table). This avoids costly scans and supports fast, targeted lookups at scale.

Topics

#DynamoDB#Global Secondary Index (GSI)#Data Modeling#Query Optimization

Community Discussion

No community discussion yet for this question.

Full DEA-C01 Practice