UPCOMING EVENT Discover how nOps streamlines your cost optimization at AWS re: Invent - BOOK A MEETING

NEW Featured eBook: AWS Cloud Cost Allocation: The Complete Guide - Download Now

In this essential guide, we’ll cover AWS AppSync key features, benefits, how to get started, frequently asked questions, and more.

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?

AWS AppSync creates serverless GraphQL and Pub/Sub APIs to query, update and publish data.

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
GraphQL APIs enable frontend developers to query multiple databases, microservices, and APIs from a single GraphQL endpoint to get exactly the data they need (image source: AWS)

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.
Pub Sub APIs (image source: Amazon Web Services)

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

Once you’ve set up an AWS account, you can use the console, API, AWS CLI, or AWS SDKs to interact with AppSync or other AWS services.

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 AppSync integrates with services such as:

Amazon DynamoDB

AppSync can directly interact with DynamoDB tables, allowing you to query and modify data stored in this NoSQL database. This integration is helpful for a high-performance mobile or web application requiring low-latency data access.

Amazon Aurora

Leverage Amazon Aurora (both MySQL and PostgreSQL-compatible editions) as a data source for your GraphQL API. This enables you to perform complex SQL queries and transactions while benefiting from Aurora’s scalability and reliability.

AWS Lambda

AWS AppSync integrates with AWS Lambda to extend your GraphQL API with custom business logic. You can execute serverless functions in response to GraphQL queries or mutations, enabling dynamic, on-demand processing of data.

Amazon OpenSearch Service (formerly Elasticsearch):

Use OpenSearch to power search and analytics capabilities within your AWS AppSync API. This allows you to index and search data efficiently, especially in large datasets.

Amazon S3

Store and retrieve files and media using Amazon S3 in conjunction with AppSync. You can manage file uploads, downloads, and metadata directly through your GraphQL API.

AWS Step Functions

Orchestrate complex workflows by integrating AWS Step Functions with AppSync. This is particularly useful for applications that require coordination across multiple AWS services.

AWS Identity and Access Management (IAM)

AppSync supports fine-grained access control using AWS IAM, enabling you to secure your GraphQL API with robust authentication and authorization mechanisms.

Amazon Cognito

Integrate with Amazon Cognito to manage user authentication and authorization for your AppSync API. This allows you to provide secure, scalable access to your API for both authenticated and unauthenticated users.’

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!