๐ This is not properly displayed? Read all of our issues online! ๐ก
Hi Reader ๐๐ฝ
we now finished all service introductions which we also showed you in the AWS Fundamentals Book ๐.
That doesn't mean we run out of content! There are still many services we want to give you introductions and 1x1 to. Once we finish this, we will grow together with you and do more deep dives into use cases, configurations, and all you can do with AWS.
Today's newsletter is about another API service: AppSync. AppSync is a managed GraphQL API.
For this newsletter, we also have something special. We've invited the AppSync Pro, Benoรฎt Bourรฉ. Ben is a consultant at Serverless Guru, builds a SaaS for a better AppSync Developer Experience, and creates a lot of content around AppSync. He shows us what AppSync is and how to use it.
The infographic shows you all the information about AppSync on one sheet. If you need a refresher after reading this issue, check it out.
That's it from us, let's hear it from Ben
AppSync is a fully managed and serverless service from AWS that allows developers to build GraphQL APIs at scale. It integrates with many other AWS services such as Amazon DynamoDB, AWS Lambda, Amazon EventBridge, Amazon Aurora, Amazon OpenSearch, and Amazon Cognito.
GraphQL is an open-source data query and manipulation language for APIs and a query runtime engine. It was created by Facebook in 2012 before being made publicly available in 2015.
GraphQL supports three types of operations:
GET
requests in RESTful APIs.PUT
, POST
and DELETE
operations in REST.GraphQL offers distinct advantages compared to REST, addressing and mitigating two common inconveniences:
GraphQL allows clients to specify the exact data they need in a single request, avoiding unnecessary network latency and overhead.
Here is an example request:
Authentication and authorization are important for every API. You don't want to expose each query and mutation to the public.
AWS AppSync offers 5 different ways to authorize users.
AppSync supports having more than one authorizer per API and lets you granularly choose which queries, mutations, and subscriptions can be used by clients using a particular authorization method.
Data sources are resources that AWS AppSync can use to interact with data stores.
The amazing thing about AppSync is that the supported all direct integrations donโt require a Lambda function, and therefore there no cold starts are involved.
โ
AWS AppSync supports the following types of data sources:
Resolvers are a set of functions that are executed by AWS AppSync to interact with the data sources. They are the glue between the data sources and the GraphQL schema.
There are two ways to write resolvers: Velocity Template Language (VTL) and JavaScript which was introduced in late 2022. If you have never worked with VTL it can be quite, special.
One resolver is composed of two functions, also known as handlers:
AWS AppSync also supports a special kind of resolver: pipeline resolvers.
They are a sequence of different resolver functions. They can be used, for example, if you need to retrieve data from different data sources before returning it to the client.
โ
One of the first steps to improve your API is to add a caching layer. AWS AppSync has built-in support for server-side caching.
A common use case is to use database responses (e.g. from DynamoDB) and save them in a key-value store like Redis. Let's say you calculate a social media feed in your application. It can make sense to save this feed to avoid unnecessary computation and load on your database.
This feature allows you to store frequent requests in a high-speed cache, allowing for a better user experience. It can also remove some load off the data sources.
โ
After working many years with AppSync in large teams I saw the need to build a better, and local-first UX.
This is when I've built GraphBolt.
GraphBolt is a desktop application that streamlines the process of working with AWS AppSync, making it easier to understand what is happening inside resolvers and how they interact with the data sources.
It also offers a GraphQL client that is optimized for AWS AppSync and a dashboard with metrics and statistics to help better understand how APIs behave.
You can try it out for free here. If you want to use it, you'll get 30% off with the code AWSFUNDAMENTALS.
โ
I just recently launched a free community-powered website to learn more about AppSync. You can find it at appsync.wtf. Back to you Sandro & Tobi
Ben, Tobi, and I are all part of an amazing AWS Community Builder Program. The program aims at people who are passionate about contributing to the community. The applications are currently open again. If you're interested in getting AWS News even faster, and want some cool perks like a Community, Merch, and free Courses apply here.
We hope Ben could give you a great overview of AppSync. Make sure to try it out to see how easy it is to build a fully-managed GraphQL API.
Have you used AppSync and GraphQL before? Are you missing any resources for trying it out?
Let us know by replying to this email. If you want to ask Ben anything, just hit him up on Twitter.
Join our community of over 8,800 readers delving into AWS. We highlight real-world best practices through easy-to-understand visualizations and one-pagers. Expect a fresh newsletter edition every two weeks.
โ Reading time: 10 minutes ๐ Main Learning: Building a Serverless Platform With SST, Lambda & Next.js โ๏ธ Read the Full Post Online ๐ Hey Reader ๐๐ฝ In this post, we want to guide you through our complete setup for our custom video platform. Our CloudWatch Book's Video Section This starts from the purchase to actually accessing our custom build video-access platform. Overview about our CloudWatch Book Landing Page & Video Platform Architecture We'll explain why we decided against a third-party...
โ Reading time: 11 minutes ๐ Main Learning: Step Functions - Express vs. Standard ๐พ GitHub Code โ๏ธ Blog Post Hey Reader while Sandro is learning something new at the AWS Community Day in Munich today, we'll explore Express and Standard Step Functions, the two types of workflows offered by AWS Step Functions. Weโll break down their differences, when to use each, and the benefits of both. Example Application: running both workflow types to see their performance differences If you want to try...
Hey Reader First things first: we apologize for not providing updates on The CloudWatch Book for a while! ๐ข Sometimes, things don't go as planned and unexpected obstacles arise. But now, we're back in action, creating videos and putting the final touches on the book's content! ๐ฅ Don't just take our word for it! As an early subscriber, here's a free video from one of our favorite chapters: Anomaly Detection ๐ In this deep-dive, you'll learn how to detect unusual patterns in metrics without...