A company runs a blog application using Amazon API Gateway, Amazon DynamoDB, and AWS Lambda. The REST API has these endpoints: GET /posts/{postId}, GET /users/{userId}, and GET /comments/{commentId}. Users are actively discussing topics in comments, and the company wants comments to appear in real time to boost engagement. Which design will reduce comment latency and improve the user experience?
Choose an answer
Tap an option to check your answer.
Correct answer: Use AWS AppSync and WebSockets to deliver comments in real time..
Why this is the answer
Using AWS AppSync and WebSockets is the most effective solution for real-time comment delivery. WebSockets provide a persistent, full-duplex communication channel between the client and server, enabling immediate push notifications of new comments without constant polling. AWS AppSync simplifies the implementation of real-time data synchronization using GraphQL subscriptions, which are built on WebSockets. Edge-optimized APIs with CloudFront caching would improve read latency for static or infrequently changing data but would not provide real-time updates for dynamic content like new comments. Polling GET /comments/{commentId} every 10 seconds would introduce significant latency and increase the load on the backend without delivering a true real-time experience. Lowering Lambda concurrency limits would likely degrade performance and increase latency, as it would restrict the number of concurrent requests the functions could handle.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed