Serverless Web App Real-Time Data Broadcasting
Publication date: March 24, 2021 (Diagram history)
This architecture shows how to create a movie voting application using AWS AppSync, AWS Lambda, AWS Step Functions, and Amazon DynamoDB. You can use backend and client-facing real-time broadcasting with managed GraphQL subscriptions over WebSockets.
Serverless Web App Real-Time Data Broadcasting
The following steps describe the architecture:
-
Amazon CloudWatch Events initiates a workflow in Step Functions every 60 seconds.
-
Step Functions triggers Lambda every 10 seconds.
-
Lambda calls The Movie DB API to retrieve metadata for a single random movie from the most popular movies list.
-
Lambda updates the Movie table, zeroes current votes, and upvotes the leaderboard in the Votes table through GraphQL mutations to AppSync.
-
AppSync updates the Movie table in DynamoDB with the single current movie retrieved from Lambda.
-
All connected clients subscribed to the backend mutation see the same current movie poster and synopsis on screen through the broadcast.
-
Clients vote on the current movie during a 10-second window, and can send and receive chat messages in a public chatroom.
-
Lambda updates the leaderboard and client movie votes through AppSync mutations.
-
The public chatroom displays current messages on a pub/sub channel through Local Resolver. Messages are not persisted on backend storage, and only new messages are displayed.
Further reading
For additional information, refer to the following resources:
Diagram history
To be notified about updates to this reference architecture diagram, subscribe to the RSS feed.
| Change | Description | Date |
|---|---|---|
Initial publication | Reference architecture diagram first published. | March 24, 2021 |
Note
To subscribe to RSS updates, you must have an RSS plugin enabled for the browser you are using.