In this talk, we will look at how to reduce backend complexity by using a service from AWS called AWS AppSync.
AWS AppSync is a fully managed GraphQL service that hooks into other AWS resources easily.
We will also talk about how to deploy AWS AppSync using the AWS AppSync Serverless Framework Components.
Full video will be hosted on the Serverless Guru Training Site, training.serverlessguru.com.
2. Serverless Guru
Founder & CEO at Serverless Guru
Senior Cloud Developer at Mode2
Application Engineer at Nike
Innovation Engineering
Department
History:
3. What is AWS?
“Amazon Web Services is a subsidiary of Amazon that provides
on-demand cloud computing platforms to individuals, companies,
and governments, on a metered pay-as-you-go basis.”
- Wikipedia
Serverless Guru
4. What is AWS API Gateway?
AWS API Gateway is a fully managed REST API service that
allows you to easily create API endpoints that connect directly to
AWS Lambda functions.
Serverless Guru
6. REST APIs with AWS API Gateway
● Easy to set up & start
● Less automation required
● Solved thousands of times
● Lots of tutorials
● No built-in documentation
● Porting Swagger and connecting
to AWS Lambda functions is a
nightmare
Pros Cons
Serverless Guru
7. What is AWS AppSync?
“A fully managed serverless GraphQL service for real-time data
queries, synchronization, communications, and offline
programming features.”
- Tara Walker, Technical Evangelist
Serverless Guru
8. What is GraphQL?
“GraphQL is a responsive data query language and server-side
runtime for querying data sources that allow for real-time data
retrieval and dynamic query execution.”
- Tara Walker, Technical Evangelist
Serverless Guru
9. What is a GraphQL Schema?
“GraphQL works at the application layer and provides a type
system for defining schemas. These schemas serve as
specifications to define how operations should be performed on
the data and how the data should be structured when retrieved.”
- Tara Walker, Technical Evangelist
Serverless Guru
10. GraphQL APIs with AWS AppSync
● Built-in Documentation
● Connect to other AWS resources
easily
● Create VTL files to write directly to
AWS DynamoDB without a
Lambda function in between
● AppSync suggests best practices
● Support for subscribers for real-
time communication
● Hard to do more advanced things
● More difficult to quickly create a
POC
● VTL files are a nightmare
● *Automation is much more
involved
Pros Cons
Serverless Guru
12. AWS AppSync Key Concepts
● GraphQL schema is attached to AWS AppSync
● Resolvers are linked to Data Sources and GraphQL data types
● Data Sources like databases, AWS Lambda, HTTP endpoints are
connected to resolvers
● VTL (Velocity Templating Language) files can remove the need for
AppSync to be connected directly an AWS Lambda function
Serverless Guru
23. VTL Mapping Templates (the magic)
● Leveraging VTL files we can remove A LOT of API code
● *All CRUD functionality can be replaced with VTL files
● AWS has their own VTL specific packages to allow the developer to
do for loops, set variables, stringify objects, etc. all inside a static file
Serverless Guru