Step functions & APPSYNC Flashcards
Step function overview
what is it used to orchestrate
features of conditions
max duration
Build server less workflow to orchestrate lambda functions
FLOW as JSON STATE MACHINE
Features: Sequence parallel conditions timeouts, error handling
Also integrate ec2, ecs, on premise, api gateway
MAX duration 1 year
possible to have human approval
use case example: order fulfillment data processing web apps any workflow
Step function
Error handling
error types
default error trigger
resolution
best practice
Errors:
- state machine definition issue, condition doesn’t match possible outcomes to be handled
- task failure, lambda function messed up
- transient issues, network went down
DEFAULT: error causes step function execution to fail entirely
resolution:
1. retry failure RETRY: INTERVALSECONDS: time between MAXATTEMPTS: max times to retry BACKOFFRATE: how to space retries
- Moving on
Catch: ERROREQUALS, NEXT: if error then move to next step
*best practice, put data in error to see what happened to debug
Step function
Standard vs express
Standard: : LONGER, EXPENSIVE
Max duration 1 year
start rate: 2000 starts per second
Express : Cheaper, SHORTER
Max duration 5 minutes
start rate: 100,000 start per second
APPSYNC overview
two main functions
how to start
Starts with uploading GraphQL schema
- use as GraphQL managed service
Appsync: Managed service that uses GRAPHQL
GraphQL: Makes it easy for apps to get specific data that it needs
-combine data from one or more source
-NoSQL data stores, relational DB, HTTP API
-Integrate with DynamoDB, aurora, elasticsearch
-custom source via AWS Lambda - Retrieve data : REALTIME WITH WEBSOCKET OR MQTT ON WEBSOCKET
- for mobile apps local data access and data sync
- cognito sync replacement
APPSYNC process
schema
query
response in?
- Upload GraphQL Schema to APPSYNC
format of data - Client will send a GraphQL Query to Appsync
data to be requested matching format - Appsync will take the client request and run a resolver and find the data in dynamoDB
- APPSYNC returns query as
GRAPHQL response in JSON
APPSYNC process
items to use it
requests from
appsync contains
data sources
integration for monitoring
1.Appsync can receive request from web apps mobile apps real time dashboard offline sync
- Appsync contains
GraphQL schema (what requests will be formatted as)
RESOLVERS: Where to get data from
3. data sources dynamodb aurora elasticsearch lambda can process extra HTTP-- PUBLIC HTTP API
4.APPSYNC can integrate with
Cloudwatch Logs for logging
Cloudwatch metrics also
Appsync security
four methods to authorize apps to interact with AWS APPSYN GRAPHQL API
four methods to authorize apps to interact with AWS APPSYN GRAPHQL API
- API_KEY
- generate just like api gateway, give to users - AWS_IAM:
- users, roles, cross account acess - OPENID_CONNECT:
- integration with third party provider and JSON web token - AMAZON_COGNITO_USER_POOLS
- integrate with users already in cognito, also can use social logins
For custom domain and HTTPS:
Use cloud front in front of APPSYNC