What is AWS AppSync?
AWS AppSync is a serverless GraphQL and Pub/Sub API service that simplifies building modern web and mobile applications. It allows you to create a flexible API to securely access, manipulate, and combine data from one or more data sources.
Key Concepts
1. GraphQL
- A query language for APIs that lets clients request exactly the data they need and nothing more.
- Solves the "over-fetching" and "under-fetching" problems of REST APIs.
2. Real-Time Data
- Supports Subscriptions over WebSockets.
- Clients can subscribe to data changes and receive updates immediately (e.g., chat messages, sports scores).
3. Offline Data Synchronization
- Automatically syncs data between the mobile app and the cloud when the device comes back online.
4. Data Sources
- Can connect to DynamoDB, Lambda, RDS, OpenSearch, and HTTP endpoints.
Exam Tips
[!IMPORTANT] GraphQL: If the exam question mentions "GraphQL", the answer is AWS AppSync.
[!TIP] "Real-time updates": AppSync allows for real-time collaboration and updates via subscriptions.
[!NOTE] API Gateway vs. AppSync:
- API Gateway: For REST APIs (standard HTTP endpoints).
- AppSync: For GraphQL APIs.
Common Use Cases
- Collaborative Apps: Whiteboards, shared documents.
- Chat Applications: Real-time messaging.
- Live Updates: Geolocation tracking, dashboards.