Skip to content

Chapter 05 - Compute

本章目標

看完本章後,你應該可以回答:

  • EC2、Auto Scaling、Lambda、ECS / Fargate 的差異是什麼?
  • ALB 和 NLB 什麼時候選?
  • 什麼 workload 適合 serverless?
  • 考題說 least operational overhead 時,compute 選型會怎麼變?

一句話

Compute 是決定程式在哪裡跑,以及系統怎麼擴縮、承受流量、降低維運負擔。

架構位置

Compute 通常位於入口層之後、資料層之前:

text
Users -> CloudFront / ALB / API Gateway -> Compute -> Database / Storage

常見服務與概念

  • EC2
  • Auto Scaling Group
  • Launch Template
  • ALB / NLB
  • Lambda
  • ECS / Fargate
  • EKS
  • Elastic Beanstalk

PM 視角

PM 要問的是 workload 的型態:流量穩定還是尖峰?需要控制 OS 嗎?是否 event-driven?能不能接受 cold start?團隊想不想管理 server?

Developer / DevOps 視角

工程師要能判斷:EC2 給控制權,Auto Scaling 給彈性,Lambda 給事件驅動與低維運,Fargate 給 container 但少管 server。

考試怎麼問

常見題型會問:

  • Web application 如何跨 AZ 擴縮
  • 短任務如何用最少維運處理
  • container workload 不想管理 EC2 cluster
  • TCP / ultra-low latency traffic 適合哪種 load balancer

常見陷阱

陷阱正確方向
看到 compute 就選 EC2先看 operational overhead 和 scaling pattern
ALB / NLB 亂選HTTP/HTTPS 多用 ALB,L4/TCP/高效能多看 NLB
Lambda 萬能要注意 runtime、timeout、cold start、state
Auto Scaling 只想成省錢它同時是 availability 和 performance 工具

Original learning content. Not official certification material.