Bird
0
0

You want to create a real-time chat app using AppSync and DynamoDB. Which approach best ensures that clients receive new messages instantly without polling?

hard🚀 Application Q15 of 15
DynamoDB - with Serverless
You want to create a real-time chat app using AppSync and DynamoDB. Which approach best ensures that clients receive new messages instantly without polling?
AHave clients poll DynamoDB every few seconds for new messages.
BUse AppSync subscriptions linked to DynamoDB streams to push updates to clients.
CUse a Lambda function to write messages to DynamoDB and notify clients via email.
DStore messages in DynamoDB and refresh the UI only when the app restarts.
Step-by-Step Solution
Solution:
  1. Step 1: Understand real-time updates in AppSync

    AppSync supports GraphQL subscriptions that can push data to clients when data changes.
  2. Step 2: Connect DynamoDB streams to subscriptions

    DynamoDB streams capture table changes and can trigger AppSync subscriptions to notify clients instantly.
  3. Step 3: Evaluate other options

    Polling wastes resources, email notifications are slow and unrelated, and UI refresh on restart is not real-time.
  4. Final Answer:

    Use AppSync subscriptions linked to DynamoDB streams to push updates to clients. -> Option B
  5. Quick Check:

    Subscriptions + DynamoDB streams = instant updates [OK]
Quick Trick: Use subscriptions with DynamoDB streams for real-time data [OK]
Common Mistakes:
MISTAKES
  • Relying on polling instead of subscriptions
  • Using email for real-time notifications
  • Ignoring DynamoDB streams integration

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More DynamoDB Quizzes