DEA-C01 Data Store Management Practice Question
A company is migrating an on-premises Apache Cassandra database to Amazon Keyspaces. The database has a table with a partition key of 'user_id' and a clustering column of 'timestamp'. The application frequently queries the last 10 records for a given user. Which table design in Keyspaces would provide the BEST query performance for this access pattern?
⚠ Common exam trap
Many exam-takers think a random partition key (Option A) or timestamp-based partition key (Option B) improves write distribution, but they overlook that the query pattern requires efficient reads within a single partition, which is best achieved by using the query filter column as the partition key and the sort column as the clustering key with the appropriate order.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Partition key: user_id, clustering column: timestamp (descending order).
It preserves the original Cassandra table design with 'user_id' as the partition key and 'timestamp' as the clustering column in descending order. This allows Keyspaces to efficiently retrieve the last 10 records for a given user by performing a range query on the clustering column within a single partition, avoiding full table scans or cross-partition queries.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Partition key: random column, clustering column: none.
Why it's wrong here
A random partition key scatters each user's records across many partitions, so fetching the last 10 records for one user needs a full table scan. Random partitioning is for write-heavy workloads needing even distribution, not per-user recency queries.
- ✗
Partition key: timestamp, clustering column: user_id.
Why it's wrong here
Making timestamp the partition key groups records by time rather than by user, so a user's last 10 records span many partitions and require scatter-gather reads. Timestamp partitioning suits time-range analytics across all users, not per-user history.
- ✗
Partition key: user_id, clustering column: none.
Why it's wrong here
Without a clustering column, all rows for a user share one partition but are stored unordered by timestamp, so retrieving the last 10 records requires reading and sorting the entire partition. It would suit a table queried only by user_id with no recency requirement.
- ✓
Partition key: user_id, clustering column: timestamp (descending order).
Why this is correct
Descending clustering order stores rows on disk newest-first, so retrieving the last 10 records for a user reads one contiguous slice from the start of the partition rather than scanning the entire partition and sorting. This directly satisfies the frequent "last 10 records per user" access pattern with a single efficient query.
Go deeper
Related to this question
About these practice questions
This DEA-C01 question is part of Courseiva's 1,321-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DEA-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DEA-C01 exam.