AWS AppSync (Frontend)
คืออะไร
AWS AppSync ในบริบทของ frontend development เป็น managed GraphQL API service ที่ช่วยให้ frontend applications ดึงข้อมูลจาก backend ได้อย่างยืดหยุ่น ผ่าน single endpoint สนับสนุน real-time subscriptions เพื่อแสดงข้อมูลใหม่ทันทีโดยไม่ต้อง refresh และ offline data sync สำหรับ mobile applications ที่ใช้ Amplify DataStore
ราคา
- Query/Mutation: $4.00/ล้าน requests
- Real-time subscriptions: $2.00/ล้าน messages
- Connection: $0.08/ล้าน connection-minutes
- ฟรี 12 เดือนแรก: 250,000 queries/mutations และ 250,000 updates/เดือน
เหมาะสำหรับ
- Frontend ที่ต้องการดึงข้อมูลหลาย resources ใน request เดียว
- แอปที่แสดงข้อมูล live เช่น dashboard, chat, live scores
- Mobile apps ที่ต้องทำงาน offline แล้ว sync เมื่อออนไลน์
- Rapid frontend development ที่เชื่อมกับ AWS backend
Use Case ตัวอย่าง
แอป project management ใช้ AppSync ให้ทีมสมาชิกเห็นการอัปเดต task แบบ real-time เมื่อใครเปลี่ยนสถานะ task ทุกคนในโปรเจกต์เห็นการเปลี่ยนแปลงทันทีโดยไม่ต้อง reload หน้าเว็บ นักพัฒนา frontend เขียนแค่ GraphQL subscription query ส่วน AppSync จัดการ WebSocket connection และ data propagation ให้ทั้งหมด