AWS AppSync
คืออะไร
AWS AppSync เป็นบริการ fully managed GraphQL API ที่เชื่อมต่อแอปพลิเคชันกับข้อมูลจาก sources หลายแหล่งพร้อมกัน เช่น DynamoDB, Lambda, RDS, HTTP APIs รองรับ real-time data ผ่าน subscriptions และ offline capabilities สำหรับ mobile apps ทำให้สร้าง flexible API สำหรับ frontend applications ได้อย่างรวดเร็ว
ราคา
- Query/Mutation: $4.00/ล้าน requests
- Real-time updates (subscriptions): $2.00/ล้าน messages + $0.08/ล้าน connection-minutes
- ฟรี 250,000 query/mutation และ 250,000 real-time updates แรก/เดือน (12 เดือนแรก)
เหมาะสำหรับ
- Mobile และ web apps ที่ต้องการ flexible data fetching
- Real-time collaborative applications
- Aggregating data จากหลาย microservices ผ่าน API เดียว
- Offline-capable mobile applications
Use Case ตัวอย่าง
แอป chat สำหรับทีมงานใช้ AppSync GraphQL subscription เพื่อแสดงข้อความใหม่แบบ real-time โดยไม่ต้อง polling ผู้ใช้ส่งข้อความผ่าน mutation ซึ่ง AppSync บันทึกลง DynamoDB และกระจาย event ไปยังทุกคนที่ subscribe channel นั้น รองรับ offline mode โดย AppSync sync ข้อความที่พลาดไปอัตโนมัติเมื่ออินเทอร์เน็ตกลับมา