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

--

--

Tools, techniques, and case studies of using serverless to release fast and scale optimally.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store