Amazon SNS (Simple Notification Service)
คืออะไร
Amazon SNS เป็นบริการ pub/sub messaging และ notification แบบ fully managed ผู้ส่ง (publisher) ส่งข้อความไปยัง topic เดียว จากนั้น SNS กระจายข้อความไปยัง subscribers หลายรายพร้อมกัน รองรับ endpoints หลายประเภท เช่น Lambda, SQS, HTTP/HTTPS, email, SMS และ mobile push notifications
ราคา
- ฟรี 1 ล้าน publish requests แรก/เดือน
- Publish ถัดไป: $0.50/ล้าน requests
- Email/Email-JSON delivery: $2.00/100,000 notifications
- SMS (ไทย): ประมาณ $0.04-0.09/ข้อความ
- Mobile push: $1.00/ล้าน notifications
- HTTP/HTTPS delivery: $0.60/ล้าน notifications
เหมาะสำหรับ
- Fan-out architecture ส่งข้อความพร้อมกันหลาย system
- แจ้งเตือน alert จาก CloudWatch ไปยัง Slack, email, SMS
- Mobile push notifications สำหรับ iOS และ Android
- Event-driven communication ระหว่าง microservices
Use Case ตัวอย่าง
ระบบ monitoring ของ startup เมื่อ CloudWatch ตรวจพบ error rate สูงผิดปกติ จะ publish alert ไปยัง SNS topic เดียว จากนั้น SNS กระจาย notification พร้อมกันไปยัง: Slack channel ของทีม ops ผ่าน Lambda, SMS ไปยังมือถือ on-call engineer และ SQS queue เพื่อเก็บ incident log โดยทีมได้รับแจ้งใน 3 ช่องทางภายใน 30 วินาที