AWS AppSync
Cloud service · AWS · Updated

AWS AppSync

In short

AWS AppSync is a managed service from Amazon Web Services that allows developers to build scalable applications by providing a flexible, secure, and scalable GraphQL API for seamlessly connecting applications to data sources like AWS DynamoDB, Lambda, and more.

Cloud Services Hub →

12 key features of AWS AppSync

AWS AppSync is a managed service that allows developers to easily build scalable applications by offering real-time data synchronization, offline data access, and data query capabilities using GraphQL.

01
Real-Time Data Synchronization

AWS AppSync allows for real-time data synchronization across connected clients, enabling seamless, live updates for web and mobile applications without manual refresh.

02
Offline Data Sync

Integrates offline data synchronization capabilities, enabling applications to function without internet connectivity and to synchronize data once the connection is restored.

03
GraphQL Support

Supports GraphQL, an efficient and flexible query language, making it easy to fetch, update, and manage data across multiple data sources with less code.

04
Fine-Grained Access Control

Offers fine-grained access control mechanisms, such as AWS Identity and Access Management (IAM) and Amazon Cognito, to secure access to data based on user identities and roles.

05
On-Demand Data Fetching

Allows for on-demand data fetching with GraphQL queries, reducing the network and processing overhead by requesting only the data that is needed.

06
Data Modeling and Versioning

Supports data modeling and automatic versioning, simplifying data schema updates and changes while maintaining application stability.

07
Integration with AWS Ecosystem

Seamlessly integrates with other AWS services, such as AWS Lambda, Amazon DynamoDB, and Amazon OpenSearch Service, enhancing application capabilities and performance.

08
Scalable and Managed Service

As a managed service, AWS AppSync scales automatically to handle millions of requests, reducing the operational overhead of managing a backend infrastructure.

09
Merged APIs

Combines multiple source GraphQL APIs into a single merged GraphQL API.

10
JavaScript and TypeScript Business Logic

Supports JavaScript and TypeScript for writing business logic.

11
Private APIs

Supports Private APIs to restrict API access.

12
AWS WAF Integration

Integrates with AWS WAF for API security.

Where AWS AppSync is used

AWS AppSync enables real-time data synchronization for mobile and web applications, supporting diverse use cases such as collaborative apps, real-time notifications, and dynamic offline experiences.

  1. 01
    Real-time Data Synchronization for Collaborative Applications

    AWS AppSync allows developers to build collaborative applications where changes made by one user are instantly reflected to all users in real time. This is especially useful for applications like shared document editing, real-time chat applications, or live updates in social media feeds, where immediate data synchronization across different users' devices enhances the user experience.

  2. 02
    Offline Data Support for Mobile Applications

    AppSync provides built-in support for managing offline data. This enables mobile applications to offer a seamless user experience even when the device is not connected to the internet. The users can continue interacting with the application, and once the network is restored, AppSync synchronizes the local changes with the cloud backend, ensuring data consistency.

  3. 03
    Device State Sync across Multiple Devices

    AWS AppSync can be used to synchronize user or application state across multiple devices in real time. This is useful in scenarios where a user switches between devices, such as from a mobile phone to a tablet or desktop, and expects the application state to be consistent across all devices, providing a seamless transition and enhancing user satisfaction.

  4. 04
    Building Data-Driven Applications with GraphQL

    AppSync integrates seamlessly with GraphQL, enabling developers to create data-driven applications by defining a schema that includes types and operations (queries, mutations, and subscriptions). This allows for more efficient data retrieval and manipulation, as clients can request exactly what they need, reducing bandwidth usage and improving application performance.

  5. 05
    IoT Device Data Management and Real-time Dashboards

    AWS AppSync can be effectively used for managing IoT device data, enabling real-time updates and communication between devices and a centralized system. This is particularly useful for building real-time monitoring dashboards that display the status of various IoT devices, allowing for immediate response to critical issues or changes in device status.

How AWS AppSync is priced

AWS AppSync pricing is based on the number of query and data modification operations, real-time updates via subscriptions, and data transfer out, with rates varying by region and no upfront commitments or fees.

On-Demand Pricing

AppSync GraphQL query and data modification operations cost $4.00 per million operations, with no minimum fees or mandatory service usage.

Real-Time Updates

AppSync GraphQL charges $2.00 per million real-time updates, including outbound broadcast messages and WebSocket operations such as client connections, plus $0.08 per million connection minutes.

Data Transfer

Data transfer for AppSync GraphQL and AppSync Events is charged at the EC2 data transfer rate.

GraphQL Caching

Optional dedicated GraphQL caches are billed hourly by instance type, without long-term commitments.

AppSync Events

AppSync Events charges $1.00 per million Event API operations and $0.08 per million connection minutes. Operations include inbound published messages, outbound broadcast messages, invoked event handlers, and WebSocket operations such as connections, subscription requests, and pings.

Free Tier Credits

Starting July 15, 2025, new AWS customers receive up to $200 in Free Tier credits applicable to eligible services including AppSync. Customers can choose a free plan available for six months after account creation or a paid plan; credits expire within 12 months of account creation.

AppSync GraphQL Free Tier

The AppSync GraphQL Free Tier includes 250,000 query or data modification operations, 250,000 real-time updates, and 600,000 connection-minutes. Usage above these allowances is billed at published rates, and the allowance expires after 12 months.

AppSync Events Free Tier

The AppSync Events Free Tier includes 250,000 real-time updates and 600,000 connection-minutes monthly for 12 months after AWS account sign-up; usage above these allowances is billed at published rates.

Services AWS AppSync works with

Amazon DynamoDBAmazon DynamoDB

AWS AppSync integrates with Amazon DynamoDB to provide a scalable, low-latency data store for applications. You can use DynamoDB as a backend data source for your GraphQL API.

AWS LambdaAWS Lambda

AWS AppSync integrates with AWS Lambda to allow executing business logic or accessing other AWS services. You can resolve GraphQL requests by calling AWS Lambda functions.

Amazon API GatewayAmazon API Gateway

AWS AppSync can use an API Gateway REST API as an HTTP data source. Resolvers map GraphQL operations to REST requests, allowing an existing REST backend to serve a GraphQL API.

Amazon AuroraAmazon Aurora

AWS AppSync connects to Aurora MySQL and PostgreSQL databases through the RDS Data API. It can discover database tables and generate GraphQL types and resolvers that run SQL queries and updates.

Amazon Aurora ServerlessAmazon Aurora Serverless

AWS AppSync uses the RDS Data API to run SQL statements against supported Aurora Serverless databases without maintaining database connections. GraphQL resolvers can read and update relational data, with mutations also driving subscription notifications.

Amazon Bedrock

AWS AppSync supports Amazon Bedrock runtime data sources, allowing JavaScript resolvers to invoke foundation models. A GraphQL operation can submit a prompt and return generated text without an intermediary Lambda function.

Amazon CloudFrontAmazon CloudFront

AWS AppSync provisions a CloudFront distribution when a custom domain is configured for a GraphQL API. The distribution serves the custom domain and routes requests to the API's GraphQL and real-time endpoints.

Amazon CloudWatchAmazon CloudWatch

AWS AppSync publishes API metrics to CloudWatch and can send request and resolver logs to CloudWatch Logs. Enhanced metrics provide additional visibility into individual resolvers and data sources, supporting alarms and performance troubleshooting.

Amazon CognitoAmazon Cognito

AWS AppSync supports Cognito user pools as an authorization mode, validating user tokens before executing GraphQL operations. Schema authorization rules can restrict access based on authenticated users and their group membership.

Amazon EventBridgeAmazon EventBridge

AWS AppSync resolvers can publish events directly to an EventBridge event bus through an EventBridge data source. Conversely, EventBridge rules can target AppSync GraphQL mutations, allowing events from other systems to update API data and notify subscribers.

What is AWS AppSync

3 min read

AWS AppSync is a highly scalable serverless back-end development service provided by Amazon Web Services (AWS) designed to support applications by allowing developers to leverage the capabilities of GraphQL for declarative data operations. It serves as a powerful tool for building modern, data-driven applications by enabling real-time updates, offline data synchronization, and data manipulation capabilities across different data sources seamlessly. 

At its core, AppSync allows applications to fetch, manipulate, and push data updates to clients in a secure, scalable, and efficient manner. One of the prominent features of AWS AppSync is its ability to provide real-time data updates and synchronization across multiple users and devices. This is incredibly invaluable for applications requiring instant data reflection across user interfaces, such as collaborative platforms, real-time gaming, and messaging apps. AppSync achieves this through subscriptions, where it pushes data updates to subscribed clients instantly whenever a change occurs, ensuring all users have access to the latest data without needing to refresh their applications manually.

AWS AppSync also offers AppSync Events for building serverless WebSocket APIs that broadcast real-time event data to subscribers without requiring you to manage connections or resource scaling.

Inbound and outbound real-time messages for both AppSync GraphQL and AppSync Events are charged per 5 KB of delivered payload; an 8 KB payload is metered as two operations.

Messages received through subscriptions have a non-adjustable maximum payload size of 240 KB.

Furthermore, AWS AppSync excels in handling offline scenarios, a critical aspect of modern application development. It intelligently manages local data caching and synchronization, allowing applications to function seamlessly even without an internet connection. Once the connection is restored, it synchronizes the local changes with the backend, ensuring data consistency and integrity across all devices and users. 

AWS AppSync integrates easily with other AWS services, providing developers a scalable, secure, and fully managed ecosystem for backend development. It supports various data sources, including Amazon DynamoDB, AWS Lambda, Amazon OpenSearch Service, and more, which can be plugged into the application's data model as per requirements. This flexibility in connecting with multiple data sources and the ability to define complex data models using GraphQL makes AppSync a versatile tool for developing a wide range of applications. 

AppSync GraphQL APIs can optionally use a dedicated cache to improve query and data modification performance.

AppSync requests have a non-adjustable maximum execution time of 30 seconds.

The resolver invocation limit for a single GraphQL request defaults to 10,000 and can be configured from 1 to 10,000; setting it to 0 or leaving it unspecified uses the default.

Security in AWS AppSync is robust, incorporating AWS Identity and Access Management (IAM) for fine-grained access control, allowing developers to define precise security protocols for their applications. Additionally, it supports authentication mechanisms like Amazon Cognito User Pools and API keys, ensuring that data access is securely managed and compliant with data regulations. 

Authorization also supports OpenID Connect providers and Lambda authorization for custom logic.

In summary, AWS AppSync stands out as an integral solution for building modern, interactive, and data-driven applications. Its support for real-time data updates, seamless offline data synchronization, broad integration capabilities with AWS services, and comprehensive security features make it a key player in the realm of serverless backend technologies. By abstracting complex data integration and synchronization challenges, AppSync allows developers to focus on building rich, engaging user experiences, pushing the boundaries of what modern applications can achieve.

Concepts related to AWS AppSync

AWS AppSync exam questions

Real practice exam questions on AWS AppSync, with the correct answer and its explanation. Answer them with every option in the exam simulator.

DVA-C02

A developer maintains an AWS AppSync GraphQL API that uses Amazon Cognito user pools for authentication. The getDashboard(projectId: ID!) query invokes a Lambda function to build a dashboard. The result varies by both the project ID and the authenticated user's Cognito sub claim. Repeated dashboard requests create high latency and excessive Lambda invocations. Dashboard data can be up to 60 seconds old. Another query, getLiveBalance, must invoke its data source on every request. Which configuration meets these requirements with the least application code?

Show answerCORRECT ANSWER

Enable per-resolver caching only for getDashboard with a 60-second TTL. Configure $context.arguments.projectId and $context.identity.sub as its caching keys.

Per-resolver caching reuses getDashboard results without caching getLiveBalance. Including both the project ID and the authenticated user's sub claim isolates entries for each user-project combination. A 60-second TTL meets the dashboard freshness requirement without requiring custom cache-management code.

SAP-C03

An industrial monitoring company uses an AWS AppSync GraphQL API to send equipment alerts to browser consoles. All consoles subscribe to onAlert, which is associated with the publishAlert mutation through @aws_subscribe. Each console requests a different subset of the Alert type's fields. All fields in Alert are non-nullable.

An ingestion service durably stores each alert and then invokes publishAlert once for each connected console. Each invocation uses a mutation selection set matching that console's subscription selection set. The mutation resolver returns the complete stored alert. During testing, consoles receive repeated notifications for the same alert, and some notifications produce errors for missing non-nullable fields.

The company wants each alert publication to reach all currently subscribed consoles without generating duplicate publications. It also wants to remove the ingestion service's dependency on the number and identities of connected consoles. Network retries and reconnect recovery are outside the scope of this change.

Which change should a solutions architect recommend?

Show answerCORRECT ANSWER

Invoke publishAlert once per alert with a mutation selection set containing every field supported by the consoles' subscriptions. Allow each console to retain its own subscription selection set, and remove console enumeration from the ingestion service.

AppSync fans out a mutation result to matching subscribers; the producer does not invoke the mutation separately for each connection. Subscription selection sets must be subsets of the mutation's selection set. Publishing once with all required fields eliminates application-generated duplicate publications and supplies the fields needed by each console.

Practice AWS AppSync in a full exam

Questions on AWS AppSync in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

Learn AWS AppSync in lessons

2 short lessons on AWS AppSync in 1 certification course.

Open the lessons

AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.