Building a Massively Scalable Serverless Chat Application with AWS AppSync

Introduction

Chart to show the significant increase in the term ‘Video conferencing’ searched in March 2020
Google Trends: Searches for ‘Video Conferencing’ in the UK. There was a significant increase in demand in March 2020.

Architecture

Chat application architecture involving Amplify, Cognito user pools, React, Apollo Client, AppSync, Lambda and DynamoDB
Chat application architecture

DynamoDB

DynamoDB table structure
DynamoDB Schema for basic Serverless chat application

GraphQL Explained

Diagram to show graphQL using just one endpoint, versus REST calling multiple endpoints
With REST we need to call separate endpoints to get the information you require. With GraphQL we need only call the same GraphQL endpoint.

Queries

Mutations

Subscriptions

AppSync Explained

Resolvers

Chat application architecture involving Amplify, Cognito user pools, React, Apollo Client, AppSync and DynamoDB
End to end flow of the chat application architecture. We use Apache VTL for our business logic.
Screenshot of the AppSync AWS console showing the templates available
VTL logic for querying a DynamoDB table for messages for a particular event chat room.

Pipeline Resolvers

Frontend — Amplify & Apollo Client

Cost

Tips and Tricks

Conclusion