it

CDK Construct Event Driven Design — สร้าง

cdk construct event driven design
CDK Construct Event Driven Design — สร้าง

CDK Event Driven

CDK Construct Event Driven Design — สร้าง

AWS CDK Construct Event Driven Architecture EventBridge SQS Lambda Step Functions Serverless TypeScript Python Production

PatternAWS ServicesUse CaseCDK Construct Level
Fan-outEventBridge → Lambda × NNotify multiple servicesL3 (Pattern)
Queue ProcessingSQS → LambdaAsync job processingL2 (SqsEventSource)
SagaStep FunctionsDistributed transactionsL3 (Custom)
CQRSAPI GW + DynamoDB StreamSeparate read/writeL3 (Custom)
Event SourcingKinesis + DynamoDBAudit trail, replayL3 (Custom)
DLQSQS DLQ + LambdaFailed event handlingL2 (deadLetterQueue)
CDK Construct Event Driven Design — สร้าง

เคล็ดลับ

  • L2: ใช้ L2 Construct เป็นหลัก Default ดี Grant Permission ง่าย
  • DLQ: ทุก Queue ต้องมี DLQ ไม่มีข้อยกเว้น ป้องกัน Event หาย
  • EventBridge: ใช้ EventBridge เป็น Central Event Router ไม่ใช่ SNS
  • Test: เขียน CDK Assertion Test + cdk-nag ทุก Stack
  • Reuse: สร้าง L3 Construct สำหรับ Pattern ที่ใช้ซ้ำ Publish npm

AWS CDK คืออะไร

IaC Framework TypeScript Python Java Construct L1 L2 L3 CloudFormation AWS Service CDK CLI Deploy synth diff Reusable npm

อ
XM Legend · เทรดเดอร์ & ผู้สอน Forex 13 ปี

ผู้ก่อตั้ง SiamCafe ตั้งแต่ปี 1997 · เทรดเดอร์สาย Forex มากกว่า 13 ปี ได้รับการยกย่องเป็น XM Legend · แบ่งปันความรู้ Forex, ไอที, AI และการเทรด จากประสบการณ์จริงในตลาดจริง