Home › AWS › AWS data services › AppSync
AWS data services · Query, warehouse and APIs · about 11 min read
AWS AppSync (GraphQL, Events)
Managed real-time APIs: AppSync Events is serverless publish and subscribe over WebSocket; AppSync GraphQL serves typed queries with live subscriptions.
In plain words
What it is
AWS AppSync is two products under one name. The newer one, AppSync Events, is a managed publish and subscribe service over WebSocket. Publish and subscribe means senders do not know who is listening: a sender publishes a message to a named channel, and every client subscribed to that channel receives it. A WebSocket is a connection the browser keeps open so the server can send messages at any time without being asked. AppSync Events holds all those connections, tracks who subscribed to what, and fans each message out to them. You write no server and keep no list of connections.
The older product, AppSync GraphQL, serves a GraphQL API. GraphQL is a query language where the caller names exactly the fields it wants, for example an order with its lines and the customer's name, in one request. AppSync answers by calling resolvers, small pieces of code that read DynamoDB, Aurora, Lambda or an HTTP service. It also supports subscriptions, so a screen is told when data it cares about changes.
A concrete example from a tyre plant. Each curing press sends readings every second, and a wall board shows every press on a line. With AppSync Events you make one channel per press, such as /plant/pune/line3/press14. The fast lane publishes a small message to that channel whenever a value changes. A supervisor's screen subscribes to /plant/pune/line3/* with a wildcard and receives updates for every press on the line. Nobody writes code to loop over connections.
Event APIs also run handlers. An onPublish handler runs when a message is published and can change, filter or reject it; an onSubscribe handler runs when a client subscribes and can refuse it. Since April 2025 handlers can call data sources directly, such as Lambda, DynamoDB or Aurora, so a handler could save each event before broadcasting it.
A radio station with many channels: the fast lane speaks into one channel, and every screen tuned to it hears the message at once, without the station knowing who is listening.
Big picture
Where it fits
The lit lane is where AppSync works. Boxes on the left feed it; boxes on the right use what it produces.
In the reference platform AppSync Events would sit where API Gateway WebSocket sits today: at the end of the fast lane, the seconds-level path for alerts. Readings come from plants through IoT Core onto Kinesis Data Streams. Managed Service for Apache Flink computes one-minute windows and limit breaches and writes only changed values into DynamoDB, the live store. DynamoDB Streams emits each change, and a Lambda function publishes it to the right AppSync channel over HTTP. AppSync then delivers it to every subscribed screen.
The design is the same as with API Gateway: a new screen first reads a snapshot from DynamoDB, then receives only changes, at most one update a second per widget. What changes is who does the fan-out. With API Gateway your Lambda posts to each connection ID and keeps a connection table; with AppSync Events the service does both. That is why the site rates it as the simpler alternative, and why it is to be tested in the physical design step rather than assumed: latency from publish to screen, behaviour on reconnect, sign-in with the company identity provider and cost at the real number of screens all need measuring.
AppSync GraphQL does not appear in the data platform. Analysts and dashboards query gold tables through Databricks SQL warehouses, AI/BI dashboards and Genie. A GraphQL layer over the lakehouse would add resolvers, timeouts and a second place to enforce access, with nothing gained for analytics. It still has a place in product teams building mobile or web apps over operational stores.
How it works
The ideas you need
| Idea | What it means |
|---|---|
| Event API | An AppSync Events API: a managed WebSocket endpoint for subscribing and an HTTP endpoint for publishing, with no schema. |
| Channel namespace | The first part of a channel path, such as /plant. Sign-in rules and handlers are set per namespace and apply to every channel in it. |
| Channel | A path such as /plant/pune/line3/press14 that messages are published to; channels are created simply by using them. |
| Wildcard subscription | Subscribing to a path ending in *, such as /plant/pune/line3/*, to receive every channel below it. |
| onPublish and onSubscribe handlers | Small JavaScript functions that run on publish or subscribe to transform, filter or reject; they can call data sources. |
| Data source integration | A connection from a handler to Lambda, DynamoDB, Aurora or other services, so events can be stored or enriched before broadcast. |
| GraphQL API | AppSync's older API type: a typed schema, resolvers that fetch each field, and subscriptions tied to mutations. |
| Resolver | The code that tells a GraphQL API how to get one field, for example by reading an item from DynamoDB. |
| Authorization mode | How callers prove who they are: API key, IAM, Amazon Cognito, OpenID Connect or a Lambda authorizer. |
Choosing
When to use it, and when not
Use it when
- You want to push small changes to many screens and would rather not keep a connection table or write the fan-out loop.
- Screens naturally subscribe by place, such as plant, line or store, and wildcard channels match that hierarchy.
- Publishers are back-end services, such as a Lambda function on DynamoDB Streams or an EventBridge rule, that can publish over HTTP.
- You need per-namespace sign-in, for example operators see their own plant and the central team sees all plants.
- A product team builds a mobile or web app over operational data and wants GraphQL with live subscriptions, outside the analytics platform.
Avoid it when
- You need guaranteed delivery or replay of missed messages; Event APIs are best effort, so clients must reload state after reconnecting.
- Messages are large snapshots or files; the publish payload limit is about 1.2 MB and each delivered 5 KB is billed as a separate operation.
- You want analytics or ad hoc questions over the lake; use Databricks SQL, AI/BI dashboards or Genie rather than GraphQL resolvers.
- Your company has not approved AppSync and API Gateway WebSocket already runs well; switching adds risk for a modest gain.
- All your data must stay inside Unity Catalog governance; neither AppSync nor DynamoDB is governed there, so use Lakebase and a Databricks App.
Production grade
What goes wrong in production
| Problem | What breaks | What to do |
|---|---|---|
| Missed messages on reconnect | A screen that drops off for a minute misses everything published in that time; Event APIs do not replay. | On every reconnect, read a fresh snapshot from DynamoDB, then resume the subscription; put a version or timestamp in each message so the client discards older ones. |
| Channel design | Channels that are too broad send every screen everything; too narrow and a supervisor needs hundreds of subscriptions. | Mirror the plant hierarchy in the path and use wildcards; keep segments short, as a channel allows at most five segments of 50 characters. |
| Subscription limit per connection | A client may hold about 200 subscriptions on one connection by default, which a dense dashboard can exceed. | Use wildcards per line or plant instead of one subscription per press, or raise the quota. |
| Publish rate and request tokens | Publishing is limited per account by request tokens, and a single WebSocket connection may publish about 25 times a second. | Publish from the back end over HTTP in batches of up to five events, emit changes only, and request quota increases before go-live. |
| Handler cost and latency | Handlers and data source calls run on every publish or subscribe; a slow Lambda in onPublish delays every screen. | Keep handlers small and in-line; store events in DynamoDB through the fast lane, not in the publish path, unless you need it. |
| Authorisation per channel | An API key at API level lets any holder subscribe to any channel, including other plants. | Use Cognito or OpenID Connect sign-in and an onSubscribe handler that checks the user's plant against the channel path. |
| Billing in 5 KB units | Each delivered message counts per 5 KB to each subscriber, so a 12 KB message to 300 screens is 900 operations. | Keep messages small, send changes not full state, and cap updates at one a second per widget. |
Alternatives
What to compare it with
| Alternative | Pick the alternative when | Pick AppSync when |
|---|---|---|
| API Gateway WebSocket | You want full control in your own Lambda code, already run API Gateway, or need its authorizers and logging; it is the site's current default. | You do not want to keep a connection table or write fan-out. |
| Databricks Apps polling Lakebase | You chose the Databricks-only lane with real-time mode, and everything must sit inside Unity Catalog. | You want true push and no always-on app compute; this lane costs more. |
| Azure Web PubSub | The platform runs on Azure; it has groups and managed connections much like AppSync Events. | You are on AWS. |
| Firebase Realtime Database or Cloud Run on Google Cloud | The platform runs on Google Cloud, which has no direct equivalent of AppSync Events. | You want one managed pub-sub service with IAM-style sign-in. |
| Self-run Socket.IO or Centrifugo | You need features or protocols the managed service lacks and have a team to run it. | A few hundred screens do not justify servers to patch and scale. |
| Amazon SNS and EventBridge | The alert must reach people by text, email or a ticket in a service desk, not a screen. | You need in-browser updates within a second. |
Cost
How you pay
Pay per use with no minimum. Event APIs bill per million operations, where an operation is an inbound publish, an outbound delivery to each subscriber, a handler run, or a WebSocket action such as connect, subscribe or ping; messages are metered in 5 KB units. Connection time is billed per million connection-minutes, and data transfer at standard rates. GraphQL APIs bill separately for queries and mutations, real-time updates and connection minutes. Check the AppSync pricing page for your region.
What drives the bill
- Outbound deliveries: changes per second times subscribed screens, in 5 KB units.
- Connection minutes from wall screens that stay connected all day on every shift.
- Handler runs and any Lambda or DynamoDB calls they make, billed by those services.
- Pings and subscribe calls from clients that reconnect often.
Cost traps
- Publishing every raw reading rather than changes; deliveries grow with readings times screens.
- Sending full board state in each message, which multiplies 5 KB units for every subscriber.
- Calling a Lambda in onPublish for simple filtering that the handler's own code could do.
- Forgetting that data source calls from handlers are billed by Lambda, DynamoDB or Aurora on top of AppSync.
Prices change; check the AWS pricing page for your region before deciding.
Security and governance
Keeping it safe
- Sign-in: prefer Amazon Cognito or OpenID Connect for people and IAM for back-end publishers; avoid API keys outside development, since anyone holding one can subscribe.
- Authorisation: set rules per channel namespace and add an onSubscribe handler that checks the user's plant or store against the channel path.
- Network: Event APIs are public endpoints; protect them with AWS WAF, and keep publishers in private subnets calling out through controlled egress.
- Encryption: traffic is HTTPS and WSS; use a custom domain with an AWS Certificate Manager certificate.
- Audit: CloudTrail records API and namespace changes; CloudWatch Logs can record each request, so keep operator names and other personal data out of channel paths.
Operating it
What to watch, and the limits
| Watch | Why |
|---|---|
| ConnectSuccess and ConnectClientError | Connections made and refused; a jump in refusals often means expired tokens or a reconnect storm. |
| PublishSuccess and PublishClientError | Events accepted and rejected on publish, including throttling. |
| OutboundMessages | Metered messages delivered to subscribers, one per 5 KB; tracks cost and fan-out. |
| SubscribeSuccess and SubscribeClientError | Subscriptions made and refused, which shows authorisation problems. |
| ActiveConnections | Open WebSocket connections; compare against the number of screens on shift. |
| Push age at the screen | Your own signal: time from the reading on Kinesis to the update on screen, against the five-second target. |
| Limit | Value and notes |
|---|---|
| Publish payload | 1.2 MB per publish request, up to 5 events in one batch; fixed |
| Subscription message | 240 KB per message received through a subscription; fixed |
| Inbound events | 10,000 a second per Event API by default; can be raised |
| Connection rate | 2,000 connect requests a second per API by default; can be raised |
| Subscriptions per connection | 200 by default; can be raised |
| Channel shape | At most 5 segments of up to 50 characters each |
Limits and quotas checked 2026-11-11; many can be raised through Service Quotas.
Decisions
Situations and verdicts
| Situation | Choice | Verdict |
|---|---|---|
| Live board for 200 press screens, team prefers no connection table | AppSync Events, one channel per press, wildcard per line, publisher is the DynamoDB Streams Lambda | Pursue with care: simpler than API Gateway WebSocket; prove latency, reconnect and cost in the physical step. |
| Same board, API Gateway WebSocket already in production | Stay on API Gateway WebSocket | Keep if you have it: it works; switch only if the connection table becomes a real burden. |
| Store managers want a GraphQL API over gold sales tables | Databricks SQL warehouse or AI/BI dashboards instead | Drop: GraphQL over the lakehouse duplicates access rules and adds timeouts for no gain. |
| Mobile app for field technicians over an operational order store | AppSync GraphQL over DynamoDB or Aurora, owned by the app team | Pursue with care: fine outside the analytics platform; keep it off the gold tables. |
FAQ
Questions people ask
What is AWS AppSync Events?
A managed publish and subscribe service over WebSocket. Clients subscribe to channels, publishers send messages over HTTP or WebSocket, and AppSync delivers them to every subscriber. It needs no schema and no connection table.
What is the difference between AppSync Events and API Gateway WebSocket?
With API Gateway you store connection IDs and post to each one yourself. AppSync Events manages channels, subscriptions and fan-out for you, with handlers for filtering. API Gateway gives more control; AppSync is less code.
Does AppSync Events guarantee delivery?
No. It is best effort with no replay, so a client that reconnects must reload current state, for example a snapshot from DynamoDB, and then resume its subscription.
Can AppSync Events write events to DynamoDB?
Yes. Since April 2025 namespace handlers can call data sources including Lambda, DynamoDB and Aurora, for example to save each event before broadcasting it. You pay for those calls separately.
Should I put GraphQL in front of my lakehouse?
Usually not. Use Databricks SQL, AI/BI dashboards, Genie or a BI tool's connector for analytics. GraphQL suits app teams serving operational data, not analytical queries.
Sources
Checked against
- AWS docs: What is AWS AppSync Events
- AWS docs: AppSync endpoints and quotas
- AWS docs: Data source integrations for AppSync Events
- AWS What's New: AppSync Events data source integrations
- AWS: AppSync pricing
- AWS docs: AppSync Events CloudWatch metrics
Checked 2026-11-11.
Related
Where it connects
Streaming on AWS and Databricks · Real-time mode and the 1-second lane · Real-time analytics · Amazon API Gateway · Amazon DynamoDB · All AWS data services
← API Gateway · Athena →