System Design for Solution Architects: from Whiteboard to Production
บทที่ 1/12

Role & Estimation

The Solution Architect Role & a Design Method

Role ของ Solution Architect / Principal Engineer ตั้งแต่ pre-sales จนถึง delivery, discovery workshop, การแปลง NFRs เป็นตัวเลข และ design method 4 steps ที่ใช้ได้ทั้งกับลูกค้าจริงและ system design interview

⏱ ประมาณ 25 นาที

ลูกค้าเดินเข้ามาพร้อมประโยคเดียว: “อยากได้ระบบที่ รองรับ flash sale ได้” งานของ solution architect คือเปลี่ยนประโยคนั้นเป็น design ที่ build ได้จริง มี architecture ชัด trade-offs ชัด estimate ที่สมเหตุสมผล และทางไปถึง production ที่ทำได้จริง บทนี้วาง method ที่จะใช้ทั้ง course

The role: from whiteboard to production

Role นี้อยู่ตรงกลางระหว่าง pre-sales และ delivery

ช่วงงานหลักDeliverables
Discoveryworkshop กับ business และ tech leaders หา goals, constraints, pain pointsrequirements, NFRs, assumptions
Solution shapingออกแบบ options และเลือก recommendation พร้อม trade-offsarchitecture diagrams, ADRs
Pursuitประมาณ effort, cost และ risks, เขียน technical section ของ proposal หรือ RFP responseestimates, proposal
De-riskingสร้าง PoC หรือ technical spike เพื่อพิสูจน์ส่วนที่เสี่ยงที่สุดก่อน commitPoC report
Handoverส่ง design ให้ delivery team และช่วงแรกของ implementationdesign doc, design clinics

จุดที่ต่างจาก architect ที่ทำแต่ document คือ hands-on: ต้องอธิบายได้ว่าระบบทำงานจริงอย่างไร at scale, เมื่อมี failure และภายใต้ constraints จริง ไม่ใช่วาดกล่องสวย ๆ

A 4-step design method

ใช้ลำดับเดิมทุกครั้ง ไม่ว่าจะเป็น workshop กับลูกค้าหรือ system design interview 45 นาที

Stepทำอะไรเวลาใน interview 45 นาที
1. Requirements & scopefunctional requirements, NFRs เป็นตัวเลข, constraints, สิ่งที่ ไม่ทำ5–10 นาที
2. EstimateQPS, storage, bandwidth (บทที่ 2 (Capacity Estimation))5 นาที
3. High-level designAPIs, data model, components หลัก, data flow10–15 นาที
4. Deep dive & trade-offsbottlenecks, failure modes, alternatives และเหตุผลที่เลือก15 นาที

Step 4 สำคัญที่สุดและควรได้เวลามากที่สุด เพราะเป็นจุดที่แสดงว่าเข้าใจระบบจริง ไม่ใช่จำ diagram มา

Make NFRs measurable

NFRs (non-functional requirements) ที่เป็นคำคุณศัพท์ใช้ design ไม่ได้ ต้องแปลงเป็นตัวเลขเสมอ

ลูกค้าพูดว่าเขียนเป็น NFR
“ต้องเร็ว”p99 latency < 300 ms ที่ 2,000 requests/s
“ห้ามล่ม”availability 99.95% ต่อเดือน (downtime ≤ ~22 นาที)
“ข้อมูลห้ามหาย”RPO = 0 สำหรับ ledger, RPO ≤ 5 นาทีสำหรับ analytics
“กู้ระบบได้เร็ว”RTO ≤ 30 นาที
“รองรับคนเยอะ”peak 20,000 QPS ช่วง flash sale 1 ชั่วโมง
“ปลอดภัย”PDPA, encryption at rest และ in transit, MFA สำหรับ admin
  • RPO (recovery point objective): ยอม data loss ได้มากสุดเท่าไร นับเป็นเวลา
  • RTO (recovery time objective): ยอม downtime หลังเกิด disaster ได้นานเท่าไร
  • ใช้ percentiles (p95, p99) ไม่ใช่ average เพราะ average ซ่อน users ที่เจอระบบช้า

Questions for a discovery workshop

  • Users & usage: ใครใช้, กี่คนต่อวัน, peak เมื่อไร (payday, 11.11, ปีใหม่)
  • Data: ข้อมูลอะไร, ขนาดเท่าไร, เก็บกี่ปี, มี personal data ไหม
  • Consistency: ตรงไหนที่ “ช้าไปนิดได้” ตรงไหนที่ “ผิดไม่ได้เลย” (เงิน, stock)
  • Integration: ต้องต่อกับ core systems หรือ legacy อะไรบ้าง และ SLA ของมัน
  • Constraints: cloud ที่องค์กรอนุญาต, regulation, data residency, งบ, deadline, skills ของทีม
  • Success: วัดความสำเร็จด้วย metrics อะไร

Trade-offs and “when simpler is better”

ทุก design decision คือ trade-off เสมอ ให้เสนอเป็น options + recommendation ไม่ใช่คำตอบเดียว

OptionProsCons
Modular monolithdeploy ง่าย, transactions ง่าย, ทีมเล็กทำได้scale แยกส่วนไม่ได้
Microservicesscale และ deploy แยกทีมได้distributed transactions, ops ซับซ้อน

Recommendation: เริ่มจาก modular monolith ที่แบ่ง modules ตาม domain ชัด แล้วแยกเป็น service เมื่อมีเหตุผลจริง เช่น scale ต่างกันมาก หรือทีมชนกัน บันทึกเหตุผลเป็น ADR (ดูรูปแบบใน course AI Solution Architect บท Architecture Fundamentals & Decisions)

แบบทดสอบ

ข้อใดเป็น non-functional requirement
ลูกค้าบอกว่า “ระบบต้องเร็ว” ควรเขียนเป็น NFR อย่างไร
RPO หมายถึงอะไร
ได้ brief สั้น ๆ จากลูกค้า ควรทำอะไรก่อน
ใน system design interview 45 นาที step ใดควรได้เวลามากที่สุด