Q90 — AWS DVA-C02 Ch.2

Question 90 of 100 | ← Chapter 2

A developer is building an application that allows users to store photos from their mobile devices in the cloud. The application must support millions of users. It uses an Amazon API Gateway REST API integrated with AWS Lambda functions to process photos. Photo metadata is stored in Amazon DynamoDB. Users must create an account to access the application. Within the application, users must be able to upload photos and retrieve previously uploaded photos. Photo sizes range from 300 KB to 5 MB.

Correct Answer: B. Use Amazon Cognito user pools to manage user accounts. Create an Amazon Cognito user pool authorizer in API Gateway to control access to the API. Use a Lambda function to store photos in Amazon S3. Store the S3 object key as part of the photo metadata in a DynamoDB table. Retrieve previously uploaded photos by querying DynamoDB for the S3 key.

Explanation

Using Amazon Cognito user pools simplifies large-scale user registration and authentication. Storing photos in Amazon S3 efficiently handles variable photo sizes (300 KB–5 MB), offers high scalability, and provides cost-effective storage. Storing the S3 object key in DynamoDB enables efficient retrieval via DynamoDB queries. Compared to alternatives, Option B achieves the requirements with minimal operational overhead, making it the optimal choice.