Q34 — AWS SAP-C02 Ch.3
Question 34 of 75 | ← Chapter 3
Q259. A company hosts a blog post application on AWS using Amazon API Gateway, Amazon DynamoDB, and AWS Lambda. The application currently does not use API keys to authorize requests. The API model is as follows: GET/posts/[postid] to get post details. GET/users[userid] to get user details. GET/comments/[commentid] to get comments details. The company has noticed users are actively discussing topics in the comments section, and the company wants to increase user engagement by marking the comments appears in real time. Which design should be used to reduce comment latency and improve user experience?
- A. Use edge-optimized API with Amazon CloudFront to cache API responses.
- B. Modify the blog application code to request GET comment[commented] every 10 seconds.
- C. Use AWS AppSync and leverage WebSockets to deliver comments. ✓
- D. Change the concurrency limit of the Lambda functions to lower the API response time.
Correct Answer: C. Use AWS AppSync and leverage WebSockets to deliver comments.
Explanation
To reduce comment latency and improve user experience, option C is the best choice. Using AWS AppSync with WebSocket can deliver real-time updates to the users' comments. With this approach, users no longer have to refresh their pages or request new data to see any changes. The real-time updates will be delivered instantly via WebSockets when they become available. Option A using edge-optimized APIs with Amazon CloudFront to cache API responses can improve response time but does not provide real-time updates. Option B would add unnecessary strain on the application by making frequent requests to GET Comment [commented], which may increase the cost of running the application. Option D changing the concurrency limit of the Lambda function will not improve the API response time since it's not the bottleneck in this scenario. AWS AppSync is a fully managed service supports real-time updates. AppSyncimport DynamoDBAppSyncpush real-time update via websocket LambdaAPIreal time