AWS rolls out AppSync to enable offline app usage
As part of its victory lap extravaganza in Las Vegas as the dominant web hosting platform, Amazon Web Services today launched a new service, AppSync, which allows applications hosted on the service to work even if they’re offline.
In a blog post published earlier today, the company did a brief walk-through of the new service, the technology behind it and the features it enables.
According to the post, AWS AppSync is a fully managed, serverless GraphQL service for real-time data queries that can work even when devices are offline — a feature made possible by caching data locally and synchronizing local data when connections become available.
GraphQL is a data query language and server-side runtime that allows for real-time data retrieval and dynamic query execution, according to Tara Walker (the technical evangelist who wrote the blog post for Amazon that I halfway understand).
When building client applications, GraphQL works at the application layer and provides a type system for defining schemas, according to Walker.
Ultimately, these schemas serve as specs that control how operations are executed on data and how data is structured. GraphQL also works off of a declarative coding model that is supported by most programming languages and libraries, Walker wrote.
Got it? If so, you’re doing better than me… but here’s what Walker says about how AppSync works.
A developer will create a schema to define the types and capabilities of the API developed in GraphQL and tied to a “Resolver” function. The schema can be based on existing data sources or AppSync can build tables automatically based on the definition of the schema.
Developers can use GraphQL features for data discovery without having knowledge of the back-end data sources (which is nifty).
And there’s more… which I’ll let Walker explain:
After a schema definition is established, an AWS AppSync client can be configured with an operation request, like a Query operation. The client submits the operation request to GraphQL Proxy along with an identity context and credentials. The GraphQL Proxy passes this request to the Resolver which maps and executes the request payload against pre-configured AWS data services like an Amazon DynamaoDB table, an AWS Lambda function, or a search capability using Amazon Elasticsearch. The Resolver executes calls to one or all of these services within a single network call minimizing CPU cycles and bandwidth needs and returns the response to the client. Additionally, the client application can change data requirements in code on demand and the AppSync GraphQL API will dynamically map requests for data accordingly, allowing prototyping and faster development.