I've been learning about the AWS AppSync architecture today from AppSync documentation.
Tried to put it into my own words so that I can remember it. Sharing it with you all! ๐งต๐
GraphQL Proxy
- Runs the GraphQL engine for processing requests
- Mapps incoming requests to logical functions
- Performs batching process called Data Loader to data sources
- Conflict detection and resolution
(1/8)
Operations
AWS AppSync supports the following GraphQL operations
- Queries (read-only fetch)
- Mutations (write then fetch)
- Subscriptions
-- long-lasting operations that can change their results over time
-- WebSockets are commonly used for this
-- See PubSub pattern
(2/8)
Action
- When a mutation is performed, a notification is sent to all connected subscribers
- Through a GraphQL subscription, clients can become subscribers
- This is the only action defined in AWS AppSync
(3/8)
Data Sources
- A persistent storage system
- A Trigger
- Requires credentials to access them
- Application state is managed by the system or the trigger defined in the data source.
- Examples would be DynamoDB, Amazon Aurora, Lambda functions, and HTTP APIs
(4/8)
Resolvers
- They connect the GraphQL and Data Sources
- Resolver functions convert GraphQL payloads to specified storage protocols via Apache Velocity Template Language(VTL) and execute them if they have necessary permissions.
(5/8)
Unit Resolvers
Defined as "A resolver that performs a single operation against a predefined data source." Although the real nature of this is not entirely clear to me yet!
I Will update you about this later!
(6/8)
Pipeline Resolvers
- A Pipeline resolver enables you to execute multiple operations against one or multiple data sources
- Consists of multiple functions
- Each function is executed in a sequential manner and can perform a single operation against a single data source
(7/8)
Function
A function can be used across multiple pipeline resolvers. They consist of
- Version
- A request and response mapping template (VTL)
- A data source
Used to perform redundant logic