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

Build distributed applications with ease using Dapr - Dev070 Meetup

Build distributed applications with ease using Dapr - Dev070 Meetup

Slides for the presentation I gave for the Dev070 meetup in The Hague.

Dapr Discord: http://bit.ly/dapr-discord
Dapr Quickstarts repository: https://github.com/dapr/quickstarts
Dapr workflow repository: https://github.com/diagrid-labs/dapr-workflow-demos

Marc Duiker

May 23, 2023
Tweet

More Decks by Marc Duiker

Other Decks in Programming

Transcript

  1. Dapr 101:
    start building
    distributed apps
    with ease

    View Slide

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

    View Slide

  3. 3

    View Slide

  4. 4
    Demos!
    What is
    Dapr?
    When to
    use Dapr?
    Why use
    Dapr?
    Q&A +
    swag

    View Slide

  5. What is Dapr?
    5

    View Slide

  6. 6
    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

  7. 7
    Distributed
    application
    runtime

    View Slide

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

    View Slide

  9. 9
    virtual or
    physical machines

    View Slide

  10. 10
    Why use Dapr?

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  14. 14
    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

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

    View Slide

  16. 16
    10th largest
    CNCF project
    Submitted
    to CNCF
    Nov 2021
    Incubation
    maturity
    level
    www.cncf.io/projects/dapr/
    Dapr project

    View Slide

  17. 17

    View Slide

  18. 18
    20.5K
    GitHub stars
    2.5K
    Contributors
    +1M
    Docker pulls
    / month
    290k
    Unique doc
    views / month
    5.9k
    Discord
    members
    18

    View Slide

  19. 19
    Contributing organizations

    View Slide

  20. 20
    Dapr users

    View Slide

  21. 21
    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

  22. 22
    App
    CosmosDB

    View Slide

  23. 23
    Sidecar
    App
    CosmosDB
    metadata:
    name: mystorage
    spec:
    type: state.azure.cosmosdb
    metadata:
    - name:
    value:
    state.save()
    state.get()
    yaml

    View Slide

  24. 24
    Redis
    metadata:
    name: mystorage
    spec:
    type: state.redis
    metadata:
    - name:
    value:
    Sidecar
    App
    state.save()
    state.get()
    yaml

    View Slide

  25. 25
    Dapr APIs are cloud agnostic.
    Do they implement the lowest
    common denominator?

    View Slide

  26. 26
    Building block APIs are
    basic, by design. Dapr adds a
    lot of functionality.

    View Slide

  27. 27
    https://docs.dapr.io/reference/components-reference/supported-state-stores/

    View Slide

  28. 28
    https://docs.dapr.io/developing-applications/building-blocks/pubsub/pubsub-cloudevents/

    View Slide

  29. 29

    View Slide

  30. 30
    Unified API with flexibility
    at the component level.

    View Slide

  31. 31
    Is Dapr a service mesh?

    View Slide

  32. 32
    No.

    View Slide

  33. 33
    Dapr & service mesh similarities:
    Distributed
    Tracing
    Secure
    Communication
    Metric
    Collection

    View Slide

  34. 34
    Developer centric
    docs.dapr.io/concepts/service-mesh/
    Building block APIs & components
    Infrastructure centric
    Service
    mesh

    Network traffic & Routing

    View Slide

  35. When to use Dapr?
    35

    View Slide

  36. 36
    You are in a large organisation
    with many different teams or
    tech stacks.

    View Slide

  37. Greenfield projects: postpone
    your architecture decisions.
    37

    View Slide

  38. When not to use Dapr?
    38

    View Slide

  39. 39
    If your team is allergic to
    containers & Kubernetes ;)

    View Slide

  40. Building block demos
    40
    github.com/dapr/quickstarts

    View Slide

  41. 41
    Service
    invocation
    Checkout
    Order
    processor
    POST

    View Slide

  42. 42
    Publish &
    subscribe
    Checkout
    Order
    processor

    View Slide

  43. 43
    State
    Management
    Redis
    Order
    processor

    View Slide

  44. 44
    The workflow engine

    View Slide

  45. 45
    Your
    Workflow
    App
    Workflow
    engine
    Append-only
    state store

    View Slide

  46. 46
    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

  47. 47
    Workflows
    Activity 1
    Activity 3
    Activity 2
    End
    Start Chaining

    View Slide

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

    View Slide

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

    View Slide