Cloud Computing คือการใช้ทรัพยากรคอมพิวเตอร์ (Server, Storage, Database, Network, Software) ผ่านอินเทอร์เน็ต โดยไม่ต้องลงทุนซื้อฮาร์ดแวร์เอง จ่ายตามการใช้งานจริง (Pay-as-you-go) สามารถ Scale ขึ้นลงได้ตามต้องการ ในปี 2026 Cloud Computing ไม่ใช่ทางเลือกอีกต่อไป แต่เป็นพื้นฐานที่ Developer ทุกคนต้องเข้าใจ เพราะแอปพลิเคชันสมัยใหม่เกือบทั้งหมดรันบน Cloud ไม่ว่าจะเป็น Startup หรือองค์กรขนาดใหญ่
ทำไม Developer ต้องเรียน Cloud? เพราะการเข้าใจ Cloud ทำให้คุณสามารถ Deploy แอปได้เอง ออกแบบ Architecture ที่ Scale ได้ ลดค่าใช้จ่าย Infrastructure เข้าใจ DevOps Pipeline และเพิ่มมูลค่าให้ตัวเองในตลาดแรงงาน ตำแหน่งที่ต้องการทักษะ Cloud มีเงินเดือนสูงกว่าค่าเฉลี่ย 20-40% ในปี 2026
Cloud Computing แบ่งออกเป็น 4 รูปแบบหลัก แต่ละรูปแบบมีระดับการจัดการที่แตกต่างกัน Developer ต้องเข้าใจความแตกต่างเพื่อเลือกใช้ให้เหมาะสมกับงาน
| Model | คุณจัดการ | Provider จัดการ | ตัวอย่าง |
|---|---|---|---|
| IaaS | OS, Runtime, App, Data | Server, Storage, Network | AWS EC2, GCP Compute, Azure VM |
| PaaS | App, Data | OS, Runtime, Server, Storage | Heroku, AWS Elastic Beanstalk, GCP App Engine |
| SaaS | ใช้งานอย่างเดียว | ทุกอย่าง | Gmail, Slack, Salesforce, GitHub |
| FaaS | เขียน Function | ทุกอย่าง + Auto Scale | AWS Lambda, GCP Cloud Functions, Azure Functions |
ถ้าต้องการ Control เต็มที่ เลือก IaaS (EC2) ถ้าต้องการ Deploy เร็วไม่อยากจัดการ Server เลือก PaaS (Elastic Beanstalk) ถ้ามี Event-driven Workload เช่น Process รูป ส่งอีเมล เลือก FaaS (Lambda) และสำหรับโปรเจกต์ใหญ่ มักใช้ผสมกันหลายรูปแบบ
Amazon Web Services (AWS) เป็น Cloud Provider อันดับ 1 ของโลก มี Market Share กว่า 31% ในปี 2026 มี Service กว่า 200 รายการ ครอบคลุมทุกความต้องการ การเริ่มต้นใช้งาน AWS มีขั้นตอนสำคัญที่ต้องทำให้ถูกต้องตั้งแต่ต้น
AWS มี Free Tier ที่ให้ใช้ Service หลักฟรี 12 เดือน เหมาะสำหรับเรียนรู้และทดลอง ประกอบด้วย EC2 t2.micro/t3.micro 750 ชั่วโมงต่อเดือน, S3 เก็บข้อมูล 5 GB, RDS db.t2.micro 750 ชั่วโมง, Lambda 1 ล้าน Request ต่อเดือน (ฟรีตลอด ไม่หมดอายุ), DynamoDB 25 GB ฟรีตลอด
# กฎเหล็กข้อแรก: ห้ามใช้ Root Account ในงานประจำวัน!
# 1. สร้าง IAM User สำหรับตัวเอง
# AWS Console → IAM → Users → Create User
# ให้สิทธิ์ AdministratorAccess (สำหรับ Admin)
# 2. เปิด MFA (Multi-Factor Authentication)
# IAM → Users → Security credentials → MFA → Assign MFA device
# ใช้ Google Authenticator หรือ Authy
# 3. สร้าง Access Key สำหรับ CLI
# IAM → Users → Security credentials → Create access key
# เก็บ Access Key ID + Secret Access Key ให้ดี
# 4. ตั้งค่า AWS CLI
pip install awscli
aws configure
# AWS Access Key ID: AKIA...
# AWS Secret Access Key: ****
# Default region name: ap-southeast-1 (Singapore — ใกล้ไทยที่สุด)
# Default output format: json
# ตั้ง Budget Alert ก่อนใช้งาน AWS เสมอ!
# AWS Console → Billing → Budgets → Create Budget
# แนะนำ: ตั้ง Monthly Budget $10 USD
# ตั้ง Alert ที่ 50%, 80%, 100% ส่ง Email แจ้งเตือน
# AWS CLI — สร้าง Budget
aws budgets create-budget \
--account-id 123456789012 \
--budget '{
"BudgetName": "Monthly-Budget",
"BudgetLimit": {"Amount": "10", "Unit": "USD"},
"TimeUnit": "MONTHLY",
"BudgetType": "COST"
}' \
--notifications-with-subscribers '[{
"Notification": {
"NotificationType": "ACTUAL",
"ComparisonOperator": "GREATER_THAN",
"Threshold": 80
},
"Subscribers": [{
"SubscriptionType": "EMAIL",
"Address": "your@email.com"
}]
}]'
EC2 เป็น Service หลักของ AWS ให้คุณสร้าง Virtual Server (Instance) ที่สามารถเลือก CPU, RAM, Storage, OS ได้ตามต้องการ เหมือนมี Server ส่วนตัวบน Cloud ที่สร้างและลบได้ภายในไม่กี่นาที
| Family | เหมาะกับ | ตัวอย่าง |
|---|---|---|
| t3/t4g | General Purpose, Web Server, Dev | t3.micro (1 vCPU, 1 GB) |
| m6i/m7g | Balanced Workload, App Server | m6i.large (2 vCPU, 8 GB) |
| c6i/c7g | Compute Intensive, Batch Processing | c6i.xlarge (4 vCPU, 8 GB) |
| r6i/r7g | Memory Intensive, Database, Cache | r6i.large (2 vCPU, 16 GB) |
| g5/p5 | GPU, Machine Learning, Rendering | g5.xlarge (4 vCPU, 16 GB, 1 GPU) |
# 1. สร้าง Key Pair สำหรับ SSH
aws ec2 create-key-pair \
--key-name my-server-key \
--query 'KeyMaterial' \
--output text > my-server-key.pem
chmod 400 my-server-key.pem
# 2. สร้าง Security Group (Firewall)
aws ec2 create-security-group \
--group-name web-server-sg \
--description "Web Server Security Group"
# อนุญาต SSH (Port 22) และ HTTP (Port 80)
aws ec2 authorize-security-group-ingress \
--group-name web-server-sg \
--protocol tcp --port 22 --cidr 0.0.0.0/0
aws ec2 authorize-security-group-ingress \
--group-name web-server-sg \
--protocol tcp --port 80 --cidr 0.0.0.0/0
# 3. สร้าง EC2 Instance
aws ec2 run-instances \
--image-id ami-0c55b159cbfafe1f0 \ # Amazon Linux 2023
--instance-type t3.micro \
--key-name my-server-key \
--security-groups web-server-sg \
--count 1
# 4. SSH เข้า Instance
ssh -i my-server-key.pem ec2-user@<public-ip>
# 5. ติดตั้ง Web Server
sudo yum update -y
sudo yum install -y nginx
sudo systemctl start nginx
sudo systemctl enable nginx
S3 เป็น Object Storage ที่ทนทาน (Durability 99.999999999% — 11 nines) ใช้เก็บไฟล์ทุกประเภท รูปภาพ วิดีโอ Backup ข้อมูล Static Website และอื่นๆ เป็น Service ที่ใช้มากที่สุดของ AWS ราคาถูก (เริ่มต้น $0.023/GB/เดือน)
import boto3
s3 = boto3.client('s3', region_name='ap-southeast-1')
# สร้าง Bucket
s3.create_bucket(
Bucket='my-app-assets-2026',
CreateBucketConfiguration={
'LocationConstraint': 'ap-southeast-1'
}
)
# อัปโหลดไฟล์
s3.upload_file(
'local-image.jpg',
'my-app-assets-2026',
'images/photo.jpg',
ExtraArgs={
'ContentType': 'image/jpeg',
'CacheControl': 'max-age=86400'
}
)
# สร้าง Presigned URL (ลิงก์ชั่วคราว เข้าถึงไฟล์ Private)
url = s3.generate_presigned_url(
'get_object',
Params={'Bucket': 'my-app-assets-2026', 'Key': 'images/photo.jpg'},
ExpiresIn=3600 # หมดอายุใน 1 ชั่วโมง
)
print(f"Download URL: {url}")
S3 สามารถ Host Static Website (HTML, CSS, JS) ได้โดยตรง เหมาะสำหรับ Landing Page, Blog, SPA (React/Vue) เมื่อรวมกับ CloudFront CDN จะได้เว็บที่เร็วมากและค่าใช้จ่ายต่ำ
# เปิด Static Website Hosting
aws s3 website s3://my-website-bucket \
--index-document index.html \
--error-document error.html
# อัปโหลด Website Files
aws s3 sync ./build/ s3://my-website-bucket \
--delete \
--cache-control "max-age=86400"
# Bucket Policy — อนุญาต Public Read
aws s3api put-bucket-policy --bucket my-website-bucket \
--policy '{
"Version": "2012-10-17",
"Statement": [{
"Sid": "PublicRead",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-website-bucket/*"
}]
}'
# CloudFront CDN — เร่งความเร็วทั่วโลก
aws cloudfront create-distribution \
--origin-domain-name my-website-bucket.s3.amazonaws.com \
--default-root-object index.html
RDS ให้คุณสร้าง Database (MySQL, PostgreSQL, MariaDB, Oracle, SQL Server, Aurora) บน Cloud โดยไม่ต้องจัดการ Server เอง AWS ดูแล Patching, Backup, Failover ให้อัตโนมัติ ช่วยให้ Developer โฟกัสที่การพัฒนาแอปแทนที่จะมานั่ง Maintain Database Server
# สร้าง RDS Instance
aws rds create-db-instance \
--db-instance-identifier my-app-db \
--db-instance-class db.t3.micro \
--engine postgres \
--engine-version 16.1 \
--master-username admin \
--master-user-password "YourStr0ngP@ssword!" \
--allocated-storage 20 \
--storage-type gp3 \
--no-publicly-accessible \
--backup-retention-period 7 \
--multi-az # High Availability — Failover อัตโนมัติ
# เชื่อมต่อจาก App
# Connection String:
# postgresql://admin:password@my-app-db.xxxx.ap-southeast-1.rds.amazonaws.com:5432/mydb
# Python + SQLAlchemy
from sqlalchemy import create_engine
engine = create_engine(
"postgresql://admin:password@my-app-db.xxxx.rds.amazonaws.com:5432/mydb",
pool_size=10,
max_overflow=20,
pool_recycle=3600
)
Multi-AZ คือการสร้าง Standby Replica ใน Availability Zone อื่น ถ้า Primary ล่ม AWS จะ Failover ไปยัง Standby อัตโนมัติภายใน 60 วินาที เหมาะกับ Production Database ที่ต้องการ High Availability ส่วน Backup จะทำอัตโนมัติทุกวัน เก็บไว้ตาม Retention Period ที่กำหนด สามารถ Restore ย้อนหลังไปยังจุดเวลาใดก็ได้ (Point-in-Time Recovery)
AWS Lambda ให้คุณรันโค้ดโดยไม่ต้องมี Server เลย แค่เขียน Function อัปโหลดขึ้นไป Lambda จะรันเมื่อมี Event เข้ามา เช่น HTTP Request, S3 Upload, DynamoDB Change, Schedule จ่ายเงินเฉพาะเวลาที่โค้ดทำงาน (คิดเป็นมิลลิวินาที) ไม่มี Request ก็ไม่ต้องจ่าย
# lambda_function.py — Python Lambda Handler
import json
import boto3
from datetime import datetime
def lambda_handler(event, context):
# API Endpoint: GET /api/status
# ดึง Query Parameters
name = event.get('queryStringParameters', {}).get('name', 'World')
# Business Logic
response_body = {
"message": f"Hello, {name}!",
"timestamp": datetime.utcnow().isoformat(),
"service": "my-api",
"version": "1.0.0"
}
return {
"statusCode": 200,
"headers": {
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "*"
},
"body": json.dumps(response_body)
}
# Deploy ด้วย AWS CLI
# 1. Zip โค้ด
# zip function.zip lambda_function.py
# 2. สร้าง Lambda Function
# aws lambda create-function \
# --function-name my-api \
# --runtime python3.12 \
# --handler lambda_function.lambda_handler \
# --role arn:aws:iam::123456789012:role/lambda-role \
# --zip-file fileb://function.zip \
# --timeout 30 \
# --memory-size 256
# 3. สร้าง API Gateway → เชื่อมกับ Lambda
# AWS Console → API Gateway → Create API → HTTP API
# Route: GET /api/status → Integration: Lambda my-api
Lambda เหมาะกับงานหลายประเภท เช่น API Backend (ร่วมกับ API Gateway), Image Processing (Resize รูปเมื่ออัปโหลดขึ้น S3), Scheduled Tasks (เทียบเท่า Cron Job), Data Processing (ETL จาก DynamoDB/Kinesis), Webhook Handler, Authentication (Custom Authorizer) และ ChatBot Backend ข้อจำกัดคือ Timeout สูงสุด 15 นาที, Memory สูงสุด 10 GB, Package Size สูงสุด 250 MB (unzipped)
DynamoDB เป็น NoSQL Database แบบ Key-Value และ Document ที่ Fully Managed โดย AWS ให้ประสิทธิภาพ Single-digit Millisecond Latency ในทุก Scale ไม่ต้อง Provision Server เหมาะกับแอปที่ต้องการ Low Latency สูง เช่น Gaming Leaderboard, Session Store, IoT Data
import boto3
from boto3.dynamodb.conditions import Key
dynamodb = boto3.resource('dynamodb', region_name='ap-southeast-1')
# สร้าง Table
table = dynamodb.create_table(
TableName='Users',
KeySchema=[
{'AttributeName': 'user_id', 'KeyType': 'HASH'}, # Partition Key
{'AttributeName': 'created_at', 'KeyType': 'RANGE'} # Sort Key
],
AttributeDefinitions=[
{'AttributeName': 'user_id', 'AttributeType': 'S'},
{'AttributeName': 'created_at', 'AttributeType': 'S'},
{'AttributeName': 'email', 'AttributeType': 'S'}
],
GlobalSecondaryIndexes=[{
'IndexName': 'email-index', # GSI — Query by Email
'KeySchema': [{'AttributeName': 'email', 'KeyType': 'HASH'}],
'Projection': {'ProjectionType': 'ALL'},
'ProvisionedThroughput': {'ReadCapacityUnits': 5, 'WriteCapacityUnits': 5}
}],
BillingMode='PAY_PER_REQUEST' # On-Demand — จ่ายตามใช้
)
# CRUD Operations
table = dynamodb.Table('Users')
# Create
table.put_item(Item={
'user_id': 'u-001',
'created_at': '2026-04-08T10:00:00',
'name': 'Somchai',
'email': 'somchai@example.com'
})
# Read (Query by Partition Key)
response = table.query(
KeyConditionExpression=Key('user_id').eq('u-001')
)
# Query by GSI (Email)
response = table.query(
IndexName='email-index',
KeyConditionExpression=Key('email').eq('somchai@example.com')
)
การ Deploy แอปขึ้น AWS มีหลายวิธี ตั้งแต่วิธีง่ายที่สุดไปจนถึงวิธีที่ซับซ้อนแต่ Production-ready แต่ละขั้นตอนเหมาะกับ Scale และความต้องการที่แตกต่างกัน
# SSH เข้า EC2 แล้ว Deploy ด้วยมือ
ssh -i key.pem ec2-user@your-ec2-ip
# ติดตั้ง Dependencies
sudo yum install -y python3 git nginx
pip3 install fastapi uvicorn gunicorn
# Clone โค้ด
git clone https://github.com/you/your-app.git
cd your-app
# รัน App ด้วย Gunicorn
gunicorn main:app -w 4 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000
# Nginx Reverse Proxy
# /etc/nginx/conf.d/app.conf
# server {
# listen 80;
# location / { proxy_pass http://127.0.0.1:8000; }
# }
# Dockerfile
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["gunicorn", "main:app", "-w", "4", "-k", "uvicorn.workers.UvicornWorker", "-b", "0.0.0.0:8000"]
# Build & Push ไป ECR (Elastic Container Registry)
aws ecr get-login-password | docker login --username AWS --password-stdin \
123456789012.dkr.ecr.ap-southeast-1.amazonaws.com
docker build -t my-app .
docker tag my-app:latest 123456789012.dkr.ecr.ap-southeast-1.amazonaws.com/my-app:latest
docker push 123456789012.dkr.ecr.ap-southeast-1.amazonaws.com/my-app:latest
ECS จัดการ Container ให้อัตโนมัติ ไม่ต้อง SSH เข้า Server ตั้ง Auto Scaling ได้ ใช้ Fargate Mode ไม่ต้องจัดการ EC2 เลย แค่บอกว่าต้องการ CPU/RAM เท่าไร AWS จัดการ Server ให้
สำหรับแอปขนาดใหญ่ที่มี Microservices จำนวนมาก EKS ให้ Managed Kubernetes ที่ AWS ดูแล Control Plane ให้ คุณจัดการแค่ Worker Nodes เหมาะกับทีมที่ใช้ Kubernetes อยู่แล้วและต้องการย้ายขึ้น Cloud
แทนที่จะกดสร้างทรัพยากรบน AWS Console ด้วยมือ (ซึ่งผิดพลาดง่าย ทำซ้ำไม่ได้ ไม่มี History) ใช้ IaC เขียนเป็นโค้ดแทน ข้อดีคือ Version Control ได้ ทำซ้ำได้ Review ได้ และ Automate ได้
# main.tf — สร้าง EC2 + RDS ด้วย Terraform
provider "aws" {
region = "ap-southeast-1"
}
# EC2 Instance
resource "aws_instance" "web" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t3.micro"
key_name = "my-key"
vpc_security_group_ids = [aws_security_group.web.id]
tags = {
Name = "web-server"
Env = "production"
}
}
# RDS PostgreSQL
resource "aws_db_instance" "db" {
identifier = "my-app-db"
engine = "postgres"
engine_version = "16.1"
instance_class = "db.t3.micro"
allocated_storage = 20
db_name = "myapp"
username = "admin"
password = var.db_password # จาก Variable ไม่ Hardcode
skip_final_snapshot = true
}
# ใช้งาน:
# terraform init # ติดตั้ง Provider
# terraform plan # ดูว่าจะสร้างอะไร
# terraform apply # สร้างจริง
# terraform destroy # ลบทั้งหมด
# AWS CDK ใช้ Python/TypeScript/Java เขียน IaC
# pip install aws-cdk-lib constructs
from aws_cdk import App, Stack
from aws_cdk import aws_ec2 as ec2
from aws_cdk import aws_rds as rds
class MyAppStack(Stack):
def __init__(self, scope, id, **kwargs):
super().__init__(scope, id, **kwargs)
vpc = ec2.Vpc(self, "VPC", max_azs=2)
db = rds.DatabaseInstance(self, "DB",
engine=rds.DatabaseInstanceEngine.postgres(
version=rds.PostgresEngineVersion.VER_16_1
),
instance_type=ec2.InstanceType.of(
ec2.InstanceClass.T3, ec2.InstanceSize.MICRO
),
vpc=vpc,
multi_az=True
)
app = App()
MyAppStack(app, "MyApp")
app.synth()
# cdk deploy
การ Monitor เป็นสิ่งจำเป็นสำหรับแอปบน Cloud ต้องรู้ว่า Server ทำงานปกติหรือไม่ Response Time เท่าไร มี Error หรือไม่ CPU/Memory ใช้ไปเท่าไร AWS CloudWatch เป็นเครื่องมือหลักที่ทุก Service ส่งข้อมูลมาให้
# ตั้ง CloudWatch Alarm — แจ้งเตือนเมื่อ CPU สูง
aws cloudwatch put-metric-alarm \
--alarm-name "High-CPU" \
--metric-name CPUUtilization \
--namespace AWS/EC2 \
--statistic Average \
--period 300 \
--threshold 80 \
--comparison-operator GreaterThanThreshold \
--evaluation-periods 2 \
--alarm-actions arn:aws:sns:ap-southeast-1:123456789012:alerts
# ส่ง Custom Metrics จาก Application
import boto3
cloudwatch = boto3.client('cloudwatch')
cloudwatch.put_metric_data(
Namespace='MyApp',
MetricData=[{
'MetricName': 'RequestLatency',
'Value': 150.5,
'Unit': 'Milliseconds',
'Dimensions': [{
'Name': 'Endpoint',
'Value': '/api/users'
}]
}]
)
สำหรับแอปที่มีหลาย Service (Microservices) X-Ray ช่วย Trace Request ตั้งแต่ต้นจนจบ เห็นว่าแต่ละ Service ใช้เวลาเท่าไร Bottleneck อยู่ตรงไหน Error เกิดจากจุดใด ช่วยให้ Debug ปัญหาใน Production ได้ง่ายขึ้นมาก
ค่าใช้จ่าย Cloud เป็นเรื่องสำคัญ ถ้าไม่จัดการดี ค่าใช้จ่ายอาจบานปลายได้อย่างรวดเร็ว นี่คือกลยุทธ์หลักในการลดค่าใช้จ่าย AWS
| กลยุทธ์ | ประหยัดได้ | เหมาะกับ |
|---|---|---|
| Reserved Instances | สูงสุด 72% | Workload คงที่ 1-3 ปี |
| Savings Plans | สูงสุด 66% | Workload ยืดหยุ่น 1-3 ปี |
| Spot Instances | สูงสุด 90% | งานที่หยุดได้ เช่น Batch, CI/CD |
| Right-sizing | 20-50% | Instance ที่ใช้ทรัพยากรไม่เต็ม |
| S3 Storage Class | สูงสุด 95% | ข้อมูลที่ไม่ค่อยเข้าถึง |
# ตรวจสอบ Cost ด้วย AWS CLI
aws ce get-cost-and-usage \
--time-period Start=2026-04-01,End=2026-04-08 \
--granularity DAILY \
--metrics "BlendedCost" \
--group-by Type=DIMENSION,Key=SERVICE
# Spot Instance — ประหยัดสูงสุด 90%
aws ec2 run-instances \
--image-id ami-0c55b159cbfafe1f0 \
--instance-type c5.xlarge \
--instance-market-options '{
"MarketType": "spot",
"SpotOptions": {
"MaxPrice": "0.05",
"SpotInstanceType": "one-time"
}
}'
# S3 Lifecycle — ย้ายข้อมูลเก่าไป Storage ที่ถูกกว่า
aws s3api put-bucket-lifecycle-configuration \
--bucket my-bucket \
--lifecycle-configuration '{
"Rules": [{
"ID": "MoveToGlacier",
"Status": "Enabled",
"Transitions": [
{"Days": 30, "StorageClass": "STANDARD_IA"},
{"Days": 90, "StorageClass": "GLACIER"},
{"Days": 365, "StorageClass": "DEEP_ARCHIVE"}
]
}]
}'
A: สำหรับผู้เริ่มต้น AWS เป็นตัวเลือกที่ดีที่สุดเพราะ Market Share สูงสุด มี Resource เรียนรู้มากที่สุด ตำแหน่งงานมากที่สุด ส่วน GCP เด่นด้าน Data/ML และ Azure เด่นด้าน Enterprise ที่ใช้ Microsoft Stack อยู่แล้ว หลักการ Cloud เหมือนกันทุก Provider เรียนรู้อันเดียวก็ย้ายไปใช้อันอื่นได้
A: เริ่มจาก AWS Cloud Practitioner (พื้นฐาน) แล้วต่อด้วย AWS Solutions Architect Associate (ยอดนิยมที่สุด) ทั้งสองใบเป็นที่ยอมรับในตลาดแรงงานและช่วยเพิ่มเงินเดือนได้จริง ใช้เวลาเตรียมสอบ 2-4 สัปดาห์สำหรับแต่ละใบ
A: ขึ้นอยู่กับการใช้งาน สำหรับแอปขนาดเล็ก (t3.micro + RDS + S3) ค่าใช้จ่ายประมาณ $15-30 ต่อเดือน ถ้าใช้ Lambda + DynamoDB + S3 (Serverless) อาจถูกกว่า $5 ต่อเดือน สำคัญคือตั้ง Budget Alert และ Monitor ค่าใช้จ่ายตลอด
A: Serverless (Lambda) เหมาะกับ Event-driven, API ที่ Traffic ไม่คงที่ ไม่อยากจัดการ Server ส่วน Container (ECS/EKS) เหมาะกับ Long-running Process, แอปที่ต้องการ Control มาก, Microservices ที่ซับซ้อน ทั้งสองไม่ได้ดีกว่ากัน ขึ้นอยู่กับ Use Case
A: เริ่มจาก Lift and Shift คือย้าย Server ปัจจุบันขึ้น EC2 ก่อน (ง่ายที่สุด) จากนั้นค่อยๆ ปรับปรุง ใช้ RDS แทน Self-managed Database, ย้าย Static Files ไป S3, เพิ่ม CloudFront เพิ่ม Load Balancer ทีละขั้นตอน อย่าพยายาม Re-architect ทั้งหมดในครั้งเดียว