Storage Services
การเลือก storage service ต้องดู access pattern, protocol, latency, sharing model, durability, backup และ cost ไม่ใช่เลือกจากชื่อที่คุ้นที่สุด
S3, EBS และ EFS
| Service | Storage type | เหมาะกับ | ไม่เหมาะกับ |
|---|---|---|---|
| Amazon S3 | Object storage | backup, static assets, logs, data lake, archive | block device หรือ filesystem ที่ต้อง update in-place บ่อย |
| Amazon EBS | Block storage | EC2 disk, database volume, boot volume | share พร้อมกันหลาย instance ทั่วไป |
| Amazon EFS | Managed file system | shared POSIX-like file access หลาย instances | workload ที่ต้อง block storage latency ต่ำมาก |
AWS Backup
AWS Backup เป็น centralized service สำหรับกำหนด backup plan, schedule, retention และ vault สำหรับ AWS resources หลายชนิด เช่น EBS, RDS, DynamoDB, EFS และบริการอื่นที่รองรับ ช่วยลดการเขียน script backup แยกเองหลายระบบ
Storage Gateway
AWS Storage Gateway เชื่อม on-premises environment กับ AWS storage ใช้เมื่อต้องการ hybrid storage เช่น file share ที่ backend เป็น S3, cached volume หรือ tape replacement สำหรับ backup workflow เดิม
DataSync
AWS DataSync ใช้ย้ายข้อมูลระหว่าง on-premises storage, edge locations, หรือ AWS storage services แบบ managed เหมาะกับ migration, periodic transfer, data lake ingestion หรือ sync ระหว่าง storage systems
Decision examples
- Static images ของ web app: S3 + CloudFront
- EC2 boot disk: EBS gp3
- หลาย EC2 ต้องอ่าน/write shared files: EFS
- Backup policy หลาย account/resource: AWS Backup
- Migrate file server เข้า S3/EFS: DataSync
- Hybrid file access จาก office ไป S3: Storage Gateway
Common mistakes
- ใช้ EBS สำหรับข้อมูลที่ควรเป็น object/archive ใน S3
- ใช้ S3 แทน filesystem โดยไม่แก้ application behavior
- ไม่มี backup lifecycle/restore test ถึงแม้เปิด backup schedule แล้ว
- ย้ายข้อมูลด้วย custom script ทั้งที่ DataSync ลด operational burden ได้
- เลือก S3, EBS หรือ EFS จาก access pattern และ sharing model ได้
- รู้ว่า backup plan ต้องรวม retention และ restore test
- รู้ว่า DataSync เหมาะกับ migration/sync และ Storage Gateway เหมาะกับ hybrid access
Review questions
- ถ้าหลาย EC2 ต้อง mount shared files ควรเริ่มพิจารณา service ใด?
- AWS Backup ช่วยแก้ปัญหาอะไร?
- DataSync เหมาะกับ migration แบบใด?