AWS AppSync simplifies application development by letting you create a flexible API to securely access, manipulate, and combine data from one or more data sources.
AWS AppSync is a serverless back-end for mobile, web, and enterprise applications. AWS AppSync makes it easy to build data driven mobile and web applications by handling securely all the application data management tasks like online and offline data access, data synchronisation, and data manipulation across multiple data sources.
AWS AppSync is a fully managed GraphQL API layer developed by Amazon Web Services. AppSync allows developers to build GraphQL APIs without much of the usual work; it handles the parsing and resolution of requests as well as connecting to other AWS services like AWS Lambda, NoSQL and SQL data stores, and HTTP APIs to gather backend data for the API.
Benefits of using AppSync
There are three main advantages:
Fully managed GraphQL API layer. AppSync allows you to skip the creation of your own GraphQL resolvers and data-source connections, resulting in significant time savings when standing up new GraphQL APIs and in faster iteration once you have customers, internal or external, using your APIs.
Real-time subscriptions and offline functionality built in. Using AppSync allows for GraphQL subscriptions, which are a great way to build applications that always present the most up-to-date state of the data. When using AppSync with the Amplify framework, you can combine subscriptions with offline functionality to create auto-updating web and mobile apps that can correctly handle unstable mobile network connections without much additional work.
Integrations with core AWS services. Since AppSync integrates with AWS Lambda, RDS, and DynamoDB, chances are you won’t need to write custom code to connect to your databases. This speeds up development for your teams using AppSync, allowing them to focus more on business logic and less on connection layers for the underlying services.
Other benefits are:
⦁ Offline access to app data
⦁ Perform complex queries and aggregation using GraphQL
⦁ Supports AWS Lambda, Amazon DynamoDB and Amazon Elasticsearch
⦁ Use the Amplify Framework to build cloud-powered applications.
⦁ Levels of data access and authorisation depending on needs
⦁ Pay-for-what-you-use, no minimum fees, no mandatory usage
GraphQL is a data language to enable client apps to fetch, change and subscribe to data from servers. In a GraphQL query, the client specifies how the data is to be structured when it is returned by the server. This makes it possible for the client to query only for the data it needs, in the format that it needs it in.
Drawbacks to using AppSync
Additional tooling you’ll need to use. Much of the useful functionality of AppSync is available only when using specialized GraphQL tooling, like the Amplify framework. This is a result of the complexity of the GraphQL protocol and its real-world implementations. This means that getting the maximum benefit out of using GraphQL in general and AppSync specifically will bring with it additional dependencies and a steep learning curve.
Lack of transparency in performance. AppSync is a managed service, and as such you don’t get access to performance settings for your GraphQL API layer. If your API layer is your company’s frontline interface for your customers, not having control over your key component’s performance attributes may pose a serious risk. AppSync can add significant overhead to your API response times, and in certain cases (e.g., if you haven’t configured the collection of tracing information in your API) you may not have any data to help you debug the increased latency.
Not all data sources are supported out of the box. If your data stores run outside of AWS, or if you are using a type of database that isn’t supported by AppSync by default, you may need to spend extra time implementing a data connection layer in your AWS Lambda functions just so you can use your data stores in AppSync.
Vendor lock-in. With proprietary products you gain efficiency at the cost of flexibility. AppSync is a proprietary solution, and if you ever decide to migrate away from AppSync, you’ll need to invest a significant amount of time in building a compatible service that you manage yourself.
AWS AppSync limits
By default, each AWS account has a limit of 25 AppSync GraphQL APIs and 1,000 queries per second per GraphQL API. These limits can be raised by opening a ticket in the AWS Support Center.
There are a few additional limits, however, that can’t be increased:
The maximum number of API keys per GraphQL API is fixed at 50. If you need more than 50 different users accessing a GraphQL API managed by AppSync, you may also authenticate access using AWS IAM, using AWS Cognito Identity Pools, or by integrating an OpenID provider.
The maximum schema document size is 1MB. If you have a very large GraphQL schema, you may need to segment your API into multiple APIs in order to use AppSync. However, needing to have multiple GraphQL API would defeat the purpose of GraphQL—to make the entire API accessible using a single endpoint.
The maximum GraphQL query execution timeout is 30 seconds. If your backend services take longer than 30 seconds to return the desired data, you’re out of luck: the queries will unavoidably time out at the 30 second mark.
You can find other AppSync limits on the AWS Service Limits page in the AWS documentation. In general, all these shouldn’t be an issue for a GraphQL API that’s designed properly. However, in some cases you may have to make specific optimizations in order to stay under the latency and response size limits.