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

Orchestrate your business logic reliably with Dapr Workflows - TEQnation

Orchestrate your business logic reliably with Dapr Workflows - TEQnation

Slides for my Dapr Workflow talk at the TEQnation conference in Utrecht, NL.

GitHub repo with the demos: https://github.com/diagrid-labs/dapr-workflow-demos

Marc Duiker

May 17, 2023
Tweet

More Decks by Marc Duiker

Other Decks in Programming

Transcript

  1. Orchestrate your
    business logic
    reliably with
    Dapr Workflows

    View Slide

  2. 2
    Azure MVP
    Dapr Community
    Manager
    ❤ pixel art
    Marc Duiker
    Sr Dev Advocate
    [email protected]

    View Slide

  3. 3
    3
    Checkout
    Dapr
    Chaining
    Workflows
    End
    Start
    Fan-out/Fan-in
    Eternal workflow Timers
    Q&A

    View Slide

  4. What is Dapr?
    4

    View Slide

  5. 5
    E-commerce system
    State
    Management
    Email Payment
    Front-end
    Shipping
    Checkout
    Inventory
    Cart
    Internet
    Queue
    I just want to
    trace my calls
    end-to-end.
    How do I encrypt
    calls with ongoing
    cert rotation?
    How do applications
    discover and call
    each other?
    How do I handle
    failed calls and
    perform retries?
    How do I secure
    access to my
    data layer?
    How do I handle
    state conflicts
    from multiple
    apps?
    How do I
    measure latency
    on my database?
    How do I
    orchestrate
    business logic
    transactions?
    How do I send
    messages to many
    applications?
    Developer
    challenges

    View Slide

  6. 6
    Distributed
    application
    runtime

    View Slide

  7. Dapr is a portable, event-
    driven, runtime for building
    distributed applications across
    cloud and edge.
    7

    View Slide

  8. 8
    virtual or
    physical machines

    View Slide

  9. Speeds up microservice
    development by providing
    a common set of building
    block APIs.
    9

    View Slide

  10. 10
    Service
    invocation
    State
    Management
    Publish &
    subscribe
    Bindings
    (input & output)
    Actors Secret
    Stores
    Configuration
    Observability
    Workflows
    Distributed Lock
    Building block APIs

    View Slide

  11. 11
    HTTP/gRPC
    Dapr API
    Dapr sidecar
    Application
    App

    View Slide

  12. 12
    POST http:// localhost:3500/v1.0/invoke/cart/method/order
    GET http:// localhost:3500/v1.0/state/inventory/item67
    POST http:// localhost:3500/v1.0/publish/order
    GET http:// localhost:3500/v1.0/secrets/vault/password42
    POST http:// localhost:3500/v1.0-alpha1/workflows/dapr/businessprocess/1234/start
    HTTP/gRPC
    Dapr API
    App

    View Slide

  13. 13
    Python
    Java
    Script
    Java
    Go
    Client
    SDKs
    C#

    View Slide

  14. 19
    Bindings
    Configuration
    State
    Management
    Publish &
    subscribe
    Observability
    Actors
    Secret
    Stores
    Workflows
    Distributed
    Lock
    Components
    AWS
    DynamoDB
    Azure
    CosmosDB
    GCP
    Firebase
    Redis
    Cassandra
    AWS
    SQS
    Azure
    Service Bus
    GCP
    Pub/Sub
    Redis
    RabbitMQ
    AWS
    Secrets mngr
    Azure
    KeyVault
    GCP
    Secret mngr
    HashiCorp
    Vault
    Kubernetes
    Secrets
    AWS
    DynamoDB
    Azure
    CosmosDB
    Redis
    MongoDB
    Postgres
    AWS
    S3
    Azure
    Storage
    GCP
    Storage
    Twilio
    Kafka
    Jeager
    Zipkin
    Prometheus
    App
    Insights
    Datadog
    Redis
    Redis Azure App
    Configuration
    Dapr
    Workflow
    Building Block APIs

    View Slide

  15. Workflows
    38

    View Slide

  16. A sequence of tasks or
    activities that are performed to
    accomplish a specific goal.
    39

    View Slide

  17. 40
    Business Process Automation
    Durable
    Logic Apps

    View Slide

  18. Dapr workflow works with all the
    other building block APIs 🎉
    41

    View Slide

  19. Workflow patterns
    42
    Workflows

    View Slide

  20. 43
    Workflows
    Activity 1
    Activity 3
    Activity 2
    End
    Start Chaining

    View Slide

  21. 44
    Workflows
    Activity 1 Activity 3
    Activity 2
    End
    Start
    Fan-out
    fan-in

    View Slide

  22. 45
    Workflows
    Eternal
    Activity
    Start
    Continue

    View Slide

  23. 46
    Workflows
    Timer
    Activity
    Timer
    End
    Start

    View Slide

  24. 47
    The workflow engine

    View Slide

  25. 48
    Your
    Workflow
    App
    Workflow
    engine
    Append-only
    state store

    View Slide

  26. 49
    Your
    Workflow
    App
    Contains definition of
    a sequence of
    activities
    Schedules and manages
    activity executions
    (incl resiliency)
    Contains workflow
    state, input and
    outputs of activities

    View Slide

  27. End
    Activity 3
    Activity 2
    Activity 1
    50
    Start
    Replay &
    checkpointing

    View Slide

  28. End
    End
    Activity 3
    Activity 3
    Activity 2
    Activity 2
    Activity 1
    Activity 1
    51
    Start Workflow
    Start
    Store start & input

    View Slide

  29. End
    End
    Activity 3
    Activity 3
    Activity 2
    Activity 2
    Activity 1
    52
    Start
    Start
    Store input
    & output
    Schedule & execute
    Activity 1

    View Slide

  30. End
    End
    Activity 3
    Activity 3
    Activity 2
    Activity 2
    Activity 1
    53
    Replay Workflow
    Start
    Activity 1 has
    been executed already

    View Slide

  31. End
    End
    Activity 3
    Activity 3
    Activity 2
    Activity 1
    54
    Start
    Start
    Store input
    & output
    Schedule & execute
    Activity 2
    Activity 1

    View Slide

  32. End
    End
    Activity 3
    Activity 3
    Activity 2
    Activity 1
    55
    Replay Workflow
    Start
    Activity 1 & 2 have
    been executed already

    View Slide

  33. End
    End
    Activity 3
    Activity 2
    Activity 1
    56
    Schedule & execute
    Activity 3
    Start
    Start
    Store input
    & output
    Activity 2
    Activity 1

    View Slide

  34. End
    End
    Activity 3
    Activity 2
    Activity 1
    57
    Replay Workflow
    Start
    Activity 1,2 & 3 have
    been executed already

    View Slide

  35. End
    Activity 3
    Activity 2
    Activity 1
    58
    Workflow is completed
    Start
    Store completion &
    output

    View Slide

  36. Workflow demos
    59
    https://github.com/diagrid-labs/dapr-workflow-demos

    View Slide

  37. Join the Dapr Discord!
    bit.ly/dapr-discord

    View Slide