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 272 discussion

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

A website allows users to upload photos to Amazon S3. An S3 event invokes an AWS Lambda function that uses the Amazon Rekognition DetectLabels operation to detect real-world objects within a photo. The website needs to store this data in a search index to allow users to quickly locate all photos associated with a label.

Which solution will meet these requirements?

  • A. Store username and label values as S3 object tags. Retrieve and index the objects based on the tag by calling the describe-tags API with the username and label value.
  • B. Store username and label values as S3 object metadata keys. Include the "x-amz-meta-" prefix for each key. Search by metadata to find all the objects that share the username and label value.
  • C. Insert an item for each S3 key, label, and user combination into an Amazon DynamoDB table. Create a global secondary index with the username as the partition key and the label as the sort key. Call the QueryItem API on the index to find all the objects that share the username and label value
  • D. Insert an item for each S3 key, label, and user combination into an Amazon DynamoDB global secondary index. Define the username as the partition key. Define the label as the sort key. Call the QueryItem API on the index to find all the objects that share the username and label value.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

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
KT_Yu
Highly Voted 2 years, 5 months ago
Selected Answer: B
Only B makes sense because QueryItem API does not exist, it is just a distractor. When uploading an object, you can also assign metadata to the object. You provide this optional information as a name-value (key-value) pair when you send a PUT or POST request to create the object. When you upload objects using the REST API, the optional user-defined metadata names must begin with "x-amz-meta-" to distinguish them from other HTTP headers. https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html
upvoted 6 times
KT_Yu
2 years, 5 months ago
https://aws.amazon.com/blogs/architecture/swiftly-search-metadata-with-an-amazon-s3-serverless-architecture/
upvoted 1 times
...
...
a15ce96
Most Recent 1 year, 3 months ago
Selected Answer: C
C meets the requirements for the fast search. Even knowing there is no QueryItem API. I don't like B because looks like there's no way to search by metadata. Even if it was possible, it wouldn't be an optimal solution in terms of performance. DynamoDB is a winner here.
upvoted 1 times
...
kyoharo
1 year, 7 months ago
Selected Answer: C
c. insert an item for each s3 key, label, and user combination into an Amazon DynamoDB table. create a global secondary index with the username as the partition key and the label as the sort key. call the queryItem API on the index to find all the objects that share the username and label value.
upvoted 1 times
...
rcaliandro
1 year, 11 months ago
Selected Answer: C
I will go with C
upvoted 2 times
...
captainpike
2 years, 2 months ago
Selected Answer: C
even knowing there is no QueryItem API
upvoted 1 times
...
rlnd2000
2 years, 3 months ago
Selected Answer: C
I think C is the best option. Can someone here explain how to search in S3 by metadata? :), you have to load the metadata to DynamoDB if you want to comply with the requirement ..."The website needs to store this data in a search index to allow users to quickly locate"...
upvoted 1 times
...
Ankit1010
2 years, 3 months ago
Answer is C
upvoted 1 times
Ankit1010
2 years, 3 months ago
Option C meets the requirements by creating a DynamoDB table with the necessary attributes and a global secondary index with the username as the partition key and the label as the sort key. This will allow the website to easily and quickly locate all photos associated with a label for a given user by calling the QueryItem API on the index. This solution is scalable and can handle large amounts of data efficiently. Option D is similar to option C, but it defines the DynamoDB global secondary index on the label as the sort key, which will not meet the requirement of locating all photos associated with a particular label for a given user.
upvoted 1 times
...
...
pancman
2 years, 4 months ago
Selected Answer: C
The answer is C. I see that a lot of people get confused by B. However, you can't search for objects in S3 by metadata as S3 doesn't offer such a feature. You would need to build a serverless architecture for that: develop a Lambda function, or use a service like Athena. Therefore, B is wrong. For reference: https://aws.amazon.com/blogs/architecture/swiftly-search-metadata-with-an-amazon-s3-serverless-architecture/
upvoted 3 times
...
Rrow
2 years, 4 months ago
Here is the official documentation for the Query operation in Amazon DynamoDB, which is also known as the QueryItem API: https://docs.aws.amazon.com/en_us/amazondynamodb/latest/APIReference/API_Query.htmlaccording to chatGPC
upvoted 1 times
...
Phinx
2 years, 4 months ago
Selected Answer: B
I think it's B. QueryItem API does not exist.
upvoted 3 times
...
BelloMio
2 years, 6 months ago
How can it be C if the QueryItem API does not exist.
upvoted 2 times
...
ubuntu1234
2 years, 6 months ago
B. Technically C seems correct, but if you search for QueryItem API for DynamoDB, you find nothing, only Query API, is found, so eventually going for B , by the process of elimination for C and D. Please correct me if you find something on QueryItem API documentation? https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dynamodb/query.html
upvoted 2 times
fe2
2 years, 5 months ago
it is not possible to search S3 objects by their metadata. So, option B is not correct.
upvoted 1 times
...
fe2
2 years, 5 months ago
""" With Amazon S3’s native search capabilities, users are limited only to searching the name of the object. Most people however, want to search by many things in addition to the name of the object. Specifically, they would like to be able to search against metadata they store with the object. Currently, this is not possible without some kind of outside system or custom code. In addition to search, many cloud customers are interested in the ability to use multiple storage providers.""" https://storageswiss.com/2017/07/18/search-an-amazon-s3-bucket-scality/
upvoted 2 times
...
...
k1kavi1
2 years, 6 months ago
Selected Answer: C
Agreed
upvoted 3 times
hamimelon
2 years, 6 months ago
What's the diff between C and D?
upvoted 2 times
by116549
2 years, 5 months ago
With C it is creating the secondary global index with "username" as the partition key and the "label" as the the sort key. In D it states "D. Insert an item for each S3 key, label, and user combination into an Amazon DynamoDB global secondary index." I think you need to create the table first and then the GSI..... Please correct me if I am wrong.
upvoted 3 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 ...