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.

RoleQuery, warehouse and APIs
StatusGenerally available (GraphQL APIs and Event APIs; Event API data source integrations added April 2025)
Verdict on this sitePursue with care
AzureAzure Web PubSub (Events); no managed GraphQL service, use API Management GraphQL
Google Cloudnone managed for push (Firebase Realtime Database or Cloud Run); Apigee for GraphQL
Databricksnone: Databricks Apps can push server-sent events from Lakebase
Open sourceSocket.IO, Centrifugo, Mercure; GraphQL Yoga or Hasura for GraphQL
Verdict: Pursue with care. AppSync Events is the simpler alternative to API Gateway WebSocket for pushing the fast lane's changes to live screens: channels and fan-out come built in. Test latency, sign-in and cost in the physical design step before choosing it. AppSync GraphQL has no role in the data platform; analytics go through Databricks SQL.

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

SourcesMove inStreamStoreProcessServeUseAcross everything: catalog · security · orchestration · observability and cost · infrastructure as codegets data fromhands data toLambdaDynamoDB StreamsEventBridgeAppSyncQuery, warehouse and APIsLive plant board in the browserSupervisor tabletsDynamoDB

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

IdeaWhat it means
Event APIAn AppSync Events API: a managed WebSocket endpoint for subscribing and an HTTP endpoint for publishing, with no schema.
Channel namespaceThe 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.
ChannelA path such as /plant/pune/line3/press14 that messages are published to; channels are created simply by using them.
Wildcard subscriptionSubscribing to a path ending in *, such as /plant/pune/line3/*, to receive every channel below it.
onPublish and onSubscribe handlersSmall JavaScript functions that run on publish or subscribe to transform, filter or reject; they can call data sources.
Data source integrationA connection from a handler to Lambda, DynamoDB, Aurora or other services, so events can be stored or enriched before broadcast.
GraphQL APIAppSync's older API type: a typed schema, resolvers that fetch each field, and subscriptions tied to mutations.
ResolverThe code that tells a GraphQL API how to get one field, for example by reading an item from DynamoDB.
Authorization modeHow 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

ProblemWhat breaksWhat to do
Missed messages on reconnectA 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 designChannels 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 connectionA 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 tokensPublishing 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 latencyHandlers 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 channelAn 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 unitsEach 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

AlternativePick the alternative whenPick AppSync when
API Gateway WebSocketYou 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 LakebaseYou 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 PubSubThe 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 CloudThe 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 CentrifugoYou 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 EventBridgeThe 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

WatchWhy
ConnectSuccess and ConnectClientErrorConnections made and refused; a jump in refusals often means expired tokens or a reconnect storm.
PublishSuccess and PublishClientErrorEvents accepted and rejected on publish, including throttling.
OutboundMessagesMetered messages delivered to subscribers, one per 5 KB; tracks cost and fan-out.
SubscribeSuccess and SubscribeClientErrorSubscriptions made and refused, which shows authorisation problems.
ActiveConnectionsOpen WebSocket connections; compare against the number of screens on shift.
Push age at the screenYour own signal: time from the reading on Kinesis to the update on screen, against the five-second target.
LimitValue and notes
Publish payload1.2 MB per publish request, up to 5 events in one batch; fixed
Subscription message240 KB per message received through a subscription; fixed
Inbound events10,000 a second per Event API by default; can be raised
Connection rate2,000 connect requests a second per API by default; can be raised
Subscriptions per connection200 by default; can be raised
Channel shapeAt 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

SituationChoiceVerdict
Live board for 200 press screens, team prefers no connection tableAppSync Events, one channel per press, wildcard per line, publisher is the DynamoDB Streams LambdaPursue with care: simpler than API Gateway WebSocket; prove latency, reconnect and cost in the physical step.
Same board, API Gateway WebSocket already in productionStay on API Gateway WebSocketKeep 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 tablesDatabricks SQL warehouse or AI/BI dashboards insteadDrop: GraphQL over the lakehouse duplicates access rules and adds timeouts for no gain.
Mobile app for field technicians over an operational order storeAppSync GraphQL over DynamoDB or Aurora, owned by the app teamPursue 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

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 →