Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Netcoreconf 2023 Madrid: Azure Durable Functions vs Dapr Workflows, the fight begins

Netcoreconf 2023 Madrid: Azure Durable Functions vs Dapr Workflows, the fight begins

Sergio Parra Guerra

April 25, 2024
Tweet

More Decks by Sergio Parra Guerra

Other Decks in Technology

Transcript

  1. #netcoreconf Introduction • Durable Functions is an extension of Azure

    Functions that lets you write stateful functions in a serverless compute environment. The extension lets you define stateful workflows by writing orchestrator functions and stateful entities by writing entity functions using the Azure Functions programming model. Behind the scenes, the extension manages state, checkpoints, and restarts for you, allowing you to focus on your business logic.
  2. #netcoreconf Underlaying technology • Behind the scenes, the Durable Functions

    extension is built on top of the Durable Task Framework, an open-source library on GitHub that's used to build workflows in code. Like Azure Functions is the serverless evolution of Azure WebJobs, Durable Functions is the serverless evolution of the Durable Task Framework. Microsoft and other organizations use the Durable Task Framework extensively to automate mission- critical processes. It's a natural fit for the serverless Azure Functions environment.
  3. #netcoreconf Orchestrator function code constraints • Using deterministic APIs •

    Dates and times • GUIDs and UUIDs • Random numbers • Bindings • Static variables • Environment variables • Network and HTTP • Thread-blocking APIs • Async APIs • Async JavaScript functions • Python coroutines • .NET threading APIs Code Versioning • Take care of unfinished orchestrations
  4. #netcoreconf Build connected distributed applications faster • APIs for building

    microservices easily • Resiliency built-in • Message and event broker integrations • Service discovery • mTLS encryption • Secrets • ..thanks to sidecar process
  5. #netcoreconf Sidecar model My App Dapr API POST http://localhost:3500/v1.0/invoke/cart/method/neworder GET

    http://localhost:3500/v1.0/state/inventory/item67 POST http://localhost:3500/v1.0/publish/shipping/orders GET http://localhost:3500/v1.0/secrets/keyvault/password POST http://localhost:3500/v1.0-beta1/workflows/dapr/businessprocess/1234/start HTTP/gRPC Application Dapr sidecar
  6. #netcoreconf HTTP API gRPC API Any cloud or edge infrastructure

    Application code Microservices written in Any code or framework… Hosting infrastructure On-Premises Azure Arc
  7. #netcoreconf Dapr Workflows Features • Workflows • Functions you write

    that define a series of tasks to be executed in a particular order. • Kinds of tasks: • Activities for executing custom logic • Durable timers for putting the workflow to sleep for arbitrary lengths of time. • Child workflows for breaking larger workflows into smaller pieces. • External event waiters for blocking workflows until they receive external event signals. • Workflow identity. Each workflow you define has a type name, and individual executions of a workflow require a unique instance ID. Only one workflow instance with a given ID can exist at any given time. • Workflow replay. Dapr Workflows maintain their execution state by using a technique known as event sourcing.
  8. #netcoreconf Dapr Workflows Features • Workflows • Infinite loops and

    eternal workflows. Ensure your workflow doesn’t: • Use infinite loops in its implementation • Schedule thousands of tasks.