Lesson 3Compare

Storage Services

การเลือก storage service ต้องดู access pattern, protocol, latency, sharing model, durability, backup และ cost ไม่ใช่เลือกจากชื่อที่คุ้นที่สุด

Object vs block vs file S3, EBS, EFS แก้ปัญหาคนละแบบ S3 สำหรับ object/archive, EBS สำหรับ EC2 disk, EFS สำหรับ shared filesystem
Backup Backup ต้องมี restore test Schedule อย่างเดียวไม่พอ ต้องรู้ retention, vault, recovery point และ restore path
Migration/hybrid DataSync และ Storage Gateway ลด custom ops ใช้ managed transfer/hybrid service แทน script เฉพาะกิจเมื่องานซ้ำหรือข้อมูลเยอะ

S3, EBS และ EFS

ServiceStorage typeเหมาะกับไม่เหมาะกับ
Amazon S3Object storagebackup, static assets, logs, data lake, archiveblock device หรือ filesystem ที่ต้อง update in-place บ่อย
Amazon EBSBlock storageEC2 disk, database volume, boot volumeshare พร้อมกันหลาย instance ทั่วไป
Amazon EFSManaged file systemshared POSIX-like file access หลาย instancesworkload ที่ต้อง 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 ได้
Before lab
  1. เลือก S3, EBS หรือ EFS จาก access pattern และ sharing model ได้
  2. รู้ว่า backup plan ต้องรวม retention และ restore test
  3. รู้ว่า DataSync เหมาะกับ migration/sync และ Storage Gateway เหมาะกับ hybrid access

Review questions

  1. ถ้าหลาย EC2 ต้อง mount shared files ควรเริ่มพิจารณา service ใด?
  2. AWS Backup ช่วยแก้ปัญหาอะไร?
  3. DataSync เหมาะกับ migration แบบใด?