Cloud Considerations (ข้อพิจารณาด้าน Cloud)

pipeline architecture style เหมาะสมอย่างยิ่งสำหรับการ deploy บน cloud เพราะมีระดับ modularity สูงและแยก filter ออกเป็นประเภทต่าง ๆ อย่างชัดเจน เนื่องจาก pipeline architecture ส่วนใหญ่ไม่ได้ซับซ้อนหรือใหญ่โตมากนัก จึง deploy เป็น monolithic architecture ได้ดี โดยให้ filter ทั้งหมดอยู่ใน deployment unit เดียวกัน

อย่างไรก็ตาม filter ก็ทำงานได้ดีใน cloud environment ในฐานะ distributed function เช่นกัน ใน AWS pipeline architecture สามารถ deploy เป็น AWS Step Functions โดยแต่ละ filter จะ deploy เป็น lambda แยกใน workflow AWS Step Functions มี workflow สองแบบ: Standard ซึ่งแต่ละขั้นตอนจะทำงานเพียงครั้งเดียวเท่านั้น และ Express ซึ่งแต่ละขั้นตอนสามารถทำงานได้มากกว่าหนึ่งครั้ง pipeline architecture style ใช้งานได้กับทั้งสองแบบ โค้ดต่อไปนี้แสดงตัวอย่าง continuous fitness function ใน Figure 12-2 ในรูปแบบ cloud deployment ทั่วไปสำหรับ pipeline architecture ซึ่ง implement เป็น AWS Step Function:

{
  "Comment": "Measure and analyze scalability trends.",
  "StartAt": "Capture Raw Data",
  "States": {
    "Capture Raw Data": {
    "Type": "Task",
    "Resource": "arn:aws:lambda:region:account_id:function:raw_data_capture",
    "Next": "Time Series Selector"
   },
    "Time Series Selector": {
    "Type": "Task",
    "Resource": "arn:aws:lambda:region:account_id:function:time_series_selector",
    "Next": "Trend Analyzer"
   },
    "Trend Analyzer": {
    "Type": "Task",
    "Resource": "arn:aws:lambda:region:account_id:function:trend_analyzer",
    "Next": "Graphing Tool"
    },
    "Graphing Tool": {
    "Type": "Task",
    "Resource": "arn:aws:lambda:region:account_id:function:graphing_tool",
    "End": true
    }
  }
}

ตัวอย่างนี้ไม่ใช่วิธีเดียวในการใช้ pipeline architecture ใน cloud environment filter ยังสามารถ deploy เป็น serverless function, containerized function หรือแม้แต่ service เดียวที่บรรจุ filter component ทั้งสี่ไว้ใน monolithic deployment