BSc Docs

SCAD Serverless Workflows

2 min read · tagged scad

Contents

Serverless Workflows

Concepts

  • Formalised processes
  • Connection of two or more steps

Connection patterns

  • Sequence / chain
  • Parallelism
  • Conditions
  • Split and join
  • Complex state machine

Description language

  • BPMN
  • BPEL

Primitives (explicit)

  • ordering
  • control flow
  • selectors
  • data transformation

Features (implicit)

  • DAGs (validation, optimisation, visualisation, editing)
  • checkpointing
  • monitoring, notification
  • connectors, integration

Models

Traditional model: Engine -> Queue -> Worker VMs -> Storage

Queue model: Engine -> Queue -> Worker Cloud Functions -> Storage

Direct executor model: Engine -> Worker Cloud Functions -> Storage

Bridge model: Engine -> Queue -> Worker VMs + Bridge to Worker Cloud Functions -> Storage

Decentralized model: Cloud Functions -> Storage

Systems and languages

  • declarative vs imperative
  • JSON vs YAML vs JavaScript
  • identification of functions
  • handling of errors, I/O
MetricsAmazon Step FunctionsIBM ComposerAzure Durable Functions
ST-safe (composition as functions)NoYesYes
Programming modelDSL(JSON)Composition library (JS)async/await (C#)
Reflective APIYes(limited)NoYes
Parallel execution supportYes(limited)NoYes(limited)
Software packaging and repositoriesYesYesYes(no repo)
Billing model$0.025 per 1000 state transitionsOrchestrator function executionOrchestrator function execution + storage cost
ArchitectureSynchronous client schedulerReactive schedulerReactive scheduler

Optimisation

  • User (workflow author) optimisation: Code
  • System (workflow engine) optimisation: Processing

Workflow preparation/rewriting: Achieve series-parallel structure for polynomial execution time from directed acyclic graphs

Function execution

  • Resource re-use

    • Keep function alive (full function reuse) vs spawn new functions (full isolation)
    • Long keep-alive -> more warm executions / short keep-alives -> less idle resources
  • Runtime pooling

    • large pool / handle high concurrency -> increases resource overhead / better performance
    • minimal pool / fast pool exhaustion -> minimize pool; less idle resources / minimize cost

Workflow execution-specific

  • Prefetching: Fetch function source upfront

    • Higher latency -> less storage cost
    • Lower latency -> more storage cost
  • Prewarming: Predictive function execution (via runtime analysis and function stats)

    • Optimistic prewarning / low treshold -> more performance
    • Pessimistic prewarning / high threshold -> less cost
    • Other domains: CPU branch predictor, proactive autoscalers, predictive caches

Avatar of Simon AnlikerSimon Anliker Someone has to write all this stuff.

About the author.