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

Dapr 101: start building distributed applications with ease

Dapr 101: start building distributed applications with ease

Slides for my session at AppDevConNL about using Dapr to build distributed applications.

Demos: https://github.com/dapr/quickstarts
Dapr Discord: http://bit.ly/dapr-discord

Marc Duiker

May 12, 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?
    4
    Why use
    Dapr?
    Q&A +
    swag

    View Slide

  5. 5

    View Slide

  6. What is Dapr?
    6

    View Slide

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

  8. 8
    Distributed
    application
    runtime

    View Slide

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

    View Slide

  10. 10
    virtual or
    physical machines

    View Slide

  11. 11
    Why use Dapr?

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

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

    View Slide

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

    View Slide

  18. 18

    View Slide

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

    View Slide

  20. 20
    Contributing organizations

    View Slide

  21. 21
    Dapr users

    View Slide

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

  23. 23
    App
    CosmosDB

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  30. 30

    View Slide

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

    View Slide

  32. 32
    Is Dapr a service mesh?

    View Slide

  33. 33
    No.

    View Slide

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

    View Slide

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

    Network traffic & Routing

    View Slide

  36. When to use Dapr?
    36

    View Slide

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

    View Slide

  38. Greenfield projects: postpone
    your architecture decisions.
    38

    View Slide

  39. When not to use Dapr?
    39

    View Slide

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

    View Slide

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

    View Slide

  42. 42
    Service
    invocation
    Checkout
    Order
    processor
    POST

    View Slide

  43. 43
    Publish &
    subscribe
    Checkout
    Order
    processor

    View Slide

  44. 44
    State
    Management
    Redis
    Order
    processor

    View Slide

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

    View Slide

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

    View Slide

  47. 📖 docs.dapr.io 📖
    Join the Dapr Discord!
    bit.ly/dapr-discord

    View Slide