Which solution will meet these requirements with the LEAST operational overhead?
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 the Lambda function to store the photos and details in the DynamoDB table. Retrieve previously uploaded photos directly from the DynamoDB table.
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 the Lambda function to store the photos in Amazon S3. Store the object’s S3 key as part of the photo details in the DynamoDB table. Retrieve previously uploaded photos by querying DynamoDB for the S3 key.
Create an IAM user for each user of the application during the sign-up process. Use IAM authentication to access the API Gateway API. Use the Lambda function to store the photos in Amazon S3. Store the object’s S3 key as part of the photo details in the DynamoDB table. Retrieve previously uploaded photos by querying DynamoDB for the S3 key.
Create a users table in DynamoDB. Use the table to manage user accounts. Create a Lambda authorizer that validates user credentials against the users table. Integrate the Lambda authorizer with API Gateway to control access to the API. Use the Lambda function to store the photos in Amazon S3. Store the object’s S3 key as par of the photo details in the DynamoDB table. Retrieve previously uploaded photos by querying DynamoDB for the S3 key.
Explanations:
While using Amazon Cognito for user management is a good practice, this option suggests storing photos directly in DynamoDB. Given that photos can range from 300 KB to 5 MB, storing them in DynamoDB would lead to high costs and inefficient data retrieval, as DynamoDB is not optimized for large binary data storage.
This option effectively uses Amazon Cognito for user management and authorizes access via API Gateway, which is a best practice. By storing photos in Amazon S3, it takes advantage of S3’s scalability and cost-effectiveness for large files. Storing the S3 key in DynamoDB for easy retrieval maintains efficient data management and minimizes operational overhead.
Creating an IAM user for each application user is impractical for scalability and management, leading to high operational overhead. This approach also does not leverage Amazon Cognito’s built-in user management features. While it suggests using S3 for photo storage (which is correct), the IAM user model is not a suitable solution for a large user base.
Although this option proposes storing photos in S3 and using a Lambda authorizer, it has significant operational overhead as it requires managing user credentials directly in a DynamoDB table. This approach does not leverage the benefits of Amazon Cognito, which simplifies user management and authentication processes, making it less efficient for scalability.