What is AWS AppSync?
AWS AppSync is a managed service that simplifies the development of GraphQL APIs by providing a scalable, secure, and real-time data layer for applications. With AppSync, you can more easily build applications that can fetch data from multiple sources such as AWS services, databases, and custom backends using a single GraphQL endpoint.
AppSync abstracts the complexities of building and managing a GraphQL API, including data synchronization, offline support, and real-time updates, allowing developers to focus on building apps rather than managing the backend. It is suited for building mobile, web, and IoT applications that require low-latency data access and real-time collaboration features.
How does AWS AppSync work?
GraphQL API
GraphQL APIs focus on querying and managing data through a flexible schema, allowing fine-grained control over the data fetched and manipulated. They are ideal for scenarios where you want to:
- Fetch and modify data from multiple sources, such as databases or microservices, through a single API endpoint.
- Integrate data from multiple data sources like Amazon DynamoDB, Aurora, and Lambda in a unified data access layer with a single network call
- Subscribe to specific data changes and receive real-time updates
PubSub API
PubSub APIs are designed for real-time, event-driven communication, where messages are broadcast to multiple subscribers who are interested in specific topics or events. For example:
- Send real-time updates to multiple subscribers, such as in a chat application or live dashboard.
- React to events in your application by publishing messages that trigger actions or update data across connected clients.
Benefits of AWS AppSync
Let’s briefly dive into the key benefits and features offered by AWS AppSync.
Simplified Data Access and Querying: Fetch, change, and subscribe to data using GraphQL, with client-defined data structures and introspection for easy onboarding. You can also quickly set up real-time APIs without needing GraphQL knowledge, using AppSync’s PubSub API wizard.
Caching: Enhance performance with server-side caching, reducing data source access and eliminating cache management overhead.
Offline Data Synchronization: Interact with data offline using Amplify DataStore, with automatic cloud-based conflict resolution and versioning.
Merged APIs: Combine multiple GraphQL APIs into a single endpoint, simplifying multi-service isolation and integration.
Real-Time Experiences: Enable real-time data updates and subscriptions for dynamic, instant user experiences. AWS AppSync supports complex real-time use cases with advanced filtering and subscription management.
Simplified Operations: Manage fine-grained access control, integrate with Amazon Cognito, and use custom domain names for your GraphQL endpoints.
Out-of-the-Box Observability: AWS AppSync integrates with many useful AWS services for monitoring, analytics, logging, and tracing, such as through AWS CloudWatch and AWS X-Ray integration.
Enterprise Security: Secure your APIs with private VPC access, AWS WAF protection, and support for private APIs.
How to get started with AWS AppSync
Here are some quick steps to get started:
#1 Create an AppSync API:
- Go to the AWS AppSync service page in the AWS Management Console.
- Click the “Create API” button.
#2 Choose API Type:
- Select “GraphQL” as the API type.
- Choose “Start from Scratch” for a new API, or “Use a DynamoDB Table” if you want to start with a predefined schema.
#3 Set Up API Details:
- Enter a specific API name (e.g., “UserManagementAPI”).
- Configure the authentication method (e.g., API Key, AWS IAM, Amazon Cognito).
#4 Create Data Sources and Schema:
- If using DynamoDB: Choose “Create a DynamoDB table” to automatically generate a table and the corresponding GraphQL schema.
- Define the schema manually: You can create your GraphQL schema manually by specifying types like UserProfile with fields such as userID and userName.
#5 Set Up DynamoDB Table (if applicable):
- Name the table (e.g., “UserProfilesTable”).
- Define userID as the primary key. The sort key is optional unless your data model requires it.
- If setting up manually, link your DynamoDB table to the data source in AppSync.
#6: Configure Resolvers:
- Set up resolvers in AppSync to connect your GraphQL queries, mutations, and subscriptions to the data sources (e.g., DynamoDB, Lambda).
#7: Review and Create:
- Review your configurations, ensuring everything is set up as intended.
- Click “Create” to finalize your AppSync API.
Once done, you’ll have a functional AWS AppSync API ready to access data. Further documentation is available through Amazon Web Services.
What services does AWS AppSync integrate with?
Amazon DynamoDB
Amazon Aurora
AWS Lambda
Amazon OpenSearch Service (formerly Elasticsearch):
Amazon S3
AWS Step Functions
AWS Identity and Access Management (IAM)
Amazon Cognito
AWS CloudWatch and AWS X-Ray
Monitor, log, and trace your AppSync API performance and operations using CloudWatch and X-Ray. This integration offers deep visibility into API execution, helping you troubleshoot and optimize your application.
Integrations with other AWS services are possible when using an AWS Lambda function.
AWS AppSync pricing
AWS AppSync pricing is fairly straightforward. Here are the main components:
- Query and Data Modification Operations: Fetch, create, update, or delete data at $4.00 per million operations.
- Real-time Updates: Keep your data in sync with real-time updates at $2.00 per million updates, plus $0.08 per million minutes of connection time.
- Merged APIs: Combine multiple AppSync source APIs into a single Merged API without additional charges. You only pay for the operations and real-time updates on the Merged API itself.
- Caching: Optionally speed up operations with a dedicated cache, charged hourly based on the instance type you select.
Understand and optimize AWS costs with nOps
If you’re looking to understand your AWS usage and costs, nOps can help.
nOps Business Contexts transforms millions of rows of contextless data into the who, what, when and why of cloud spend — making it easy to get 100% visibility of your AWS cloud costs and usage so your bills are never a surprise or mystery.
Allocate 100% of your AWS costs, including EKS. Kubernetes costs are often a black box — no longer with nOps. Understand and allocate your unified AWS spend in one platform.
Automated resource tagging. You don’t need to have all your resources tagged to allocate costs. Create dynamic rules by region, tags, operation, accounts, and usage types to allocate costs back to custom cost centers.
40+ views & filters. Map hourly costs by any relevant engineering concept (deployment, service, namespace, label, pod, container…) or finance concept (cost unit, purchase type, line item, cost allocation tag…).
Custom reports & dashboards for the whole team. Monthly reporting and reconciliation can take hours; with nOps only minutes. Tailor dashboards and Slack/email reports to your needs, whether you’re a CFO or VP of Engineering.
The best part? nOps is an all-in-one solution for all of your AWS cloud optimization needs: automated commitment management, rightsizing, resource scheduling, workload management, Spot usage, storage optimization, and more.
Join our customers using nOps to understand your cloud costs and leverage automation with complete confidence by booking a demo today!