exam questions

Exam AWS Certified Developer Associate All Questions

View all questions & answers for the AWS Certified Developer Associate exam

Exam AWS Certified Developer Associate topic 1 question 18 discussion

Exam question from Amazon's AWS Certified Developer Associate
Question #: 18
Topic #: 1
[All AWS Certified Developer Associate Questions]

A company that has multiple offices uses an Amazon DynamoDB table to store employee payroll information. Item attributes consist of employee names, office identifiers, and cumulative daily hours worked The most frequently used query extracts a report of an alphabetical subset of employees for a specific office.
Which design of the DynamoDB table primary key will have the MINIMUM performance impact?

  • A. Partition key on the office identifier and sort key on the employee name
  • B. Partition key on the employee name and sort key on the office identifier
  • C. Partition key on the employee name
  • D. Partition key on the office identifier
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
quirio1983
Highly Voted 2 years, 7 months ago
Selected Answer: A
It´s A
upvoted 11 times
...
andregri
Highly Voted 2 years, 6 months ago
Selected Answer: B
B because the partition key must have high caridinality to avoid hot partitions
upvoted 9 times
JonasKahnwald
5 months, 1 week ago
That doesn't meet the requirements.
upvoted 1 times
...
...
sumanshu
Most Recent 4 months, 1 week ago
Selected Answer: A
A) Correct - The partition key on the office identifier ensures that all employees for a particular office are grouped together in the same partition, which allows for efficient queries based on office. The sort key on the employee name enables sorting employees alphabetically within each office partition, which is exactly the desired functionality.
upvoted 2 times
sumanshu
4 months, 1 week ago
B) Eliminated: Using employee name as the partition key means that items (employees) will be distributed across multiple partitions based on the employee name, which is not ideal for the most frequent query.
upvoted 2 times
sumanshu
4 months, 1 week ago
C) Eliminated: This design only uses the employee name as the partition key, which would not allow for efficient querying of employees by office.
upvoted 2 times
sumanshu
4 months, 1 week ago
D) Eliminated: Using the office identifier as the partition key means that all employees in the same office will be stored in the same partition, which is efficient for filtering by office. However, this design does not allow for sorting by employee name within each office. Sorting would require a separate operation, adding unnecessary complexity and performance overhead.
upvoted 2 times
...
...
...
...
JonasKahnwald
5 months, 1 week ago
Selected Answer: A
Partition Key on Office Identifier: This ensures that all employees from the same office are stored together, which is efficient for querying by office. Sort Key on Employee Name: This allows you to retrieve employees in alphabetical order within each office, which matches the query requirements.
upvoted 2 times
...
thucta96dn
5 months, 3 weeks ago
Selected Answer: B
partition key should be employee name
upvoted 1 times
JonasKahnwald
5 months, 1 week ago
No, it should be the office identifier. You want separate reports per office.
upvoted 2 times
...
...
trainee46
7 months ago
Selected Answer: A
Definately A. If the name were the partition key, but we need an alphabetical range, e.g. all names starting with C-G, the it would be completeley impossbile to write a queasonable query for that the does not a full scan. If the office name is the partition key, then we can query for the speciifc office and sort by last name, thus easily selecting a range of last names such as in my example. General rule: The partition key must be known when writing querying the database. Thi isa certianly true for the offices, but in the sketched scenario not for the names.
upvoted 1 times
...
SD_CS
1 year, 2 months ago
Selected Answer: A
The design has to be driven by requirement. The queries would be select ones based on an office and then on employees in the office. So I feel the part key should be office id, and the sort key emp name.
upvoted 1 times
...
gilleep_17
1 year, 3 months ago
not sure but A
upvoted 1 times
...
AsmaZoheb
1 year, 3 months ago
Selected Answer: A
minimum performance impact is in answer A , for answer B in partition key employee name is not good choice as many employees can have same name
upvoted 1 times
...
xdkonorek2
1 year, 4 months ago
Selected Answer: A
The design of the DynamoDB table primary key that will have the minimum performance impact is: A. Partition key on the office identifier and sort key on the employee name Rationale: The most frequent query is to extract a report of an alphabetical subset of employees for a specific office. With the office identifier as the partition key, all employees belonging to that office will be stored together in the same partition. This query can retrieve the required data from a single partition efficiently. Using the employee name as the sort key allows sorting the results alphabetically as required by the query. This design matches the access pattern of the query by grouping related data together in a partition while also enabling the sorting of results. Other designs may result in data for the same office being stored across multiple partitions, impacting performance for this common query pattern.
upvoted 2 times
...
ninomfr64
1 year, 8 months ago
Selected Answer: B
Tricky question. Best practice tells us to use employee name as partition key as it has higher cardinality, however the most frequent query extracts employees for a specific office thus ideally the query KeyConditionExpression would be "officeID = office123". If performance is the primary concern I would go for a primary key with partition key on the employee name and sort key on the office identifier and having a GSI with partition key on the office identifier, thus B.
upvoted 1 times
...
rcaliandro
1 year, 10 months ago
Another tricky question this time I won't vote because I'm torn between A and B. Most of you says A but why do you exclude the B? As far as I know an employee table in DynamoDB should be designed to avoid hot partitions and design the partition key in order to distribuite the data accross all the table, even if we query by officeID. Let us imagine that the company has only 6 offices and hundreds of employees it will be a mass to maintain the table and most of times it will be throttled. So, in my opinion is: "B - Create a partition key on the employee name and sort key on the office identifier"
upvoted 2 times
...
MrTee
2 years ago
Selected Answer: A
This design allows to query for a specific office identifier and return the results sorted by employee name in alphabetical order.
upvoted 1 times
...
piavik
2 years ago
Unclear question MINIMUM performance impact (i.e. LESS possible performance boost) will be with C. "A" will give MAXIMUM performance impact.
upvoted 2 times
...
nearavenac
2 years ago
Selected Answer: C
C have the MINIMUM performance impact
upvoted 1 times
...
Dr_Chomp
2 years ago
Selected Answer: B
Also went with employee as it would provide highest cardinality!
upvoted 1 times
...
captainpike
2 years, 1 month ago
What does "MINIMUM performance impact" mean? IMO "A" is going to give the maximum performance impact and "C" the minimum
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago