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 full-size slide

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

    View full-size slide

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

    View full-size slide

  4. What is Dapr?
    6

    View full-size slide

  5. 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 full-size slide

  6. 8
    Distributed
    application
    runtime

    View full-size slide

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

    View full-size slide

  8. 10
    virtual or
    physical machines

    View full-size slide

  9. 11
    Why use Dapr?

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  13. 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 full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  17. 20
    Contributing organizations

    View full-size slide

  18. 21
    Dapr users

    View full-size slide

  19. 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 full-size slide

  20. 23
    App
    CosmosDB

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  28. 32
    Is Dapr a service mesh?

    View full-size slide

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

    View full-size slide

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

    Network traffic & Routing

    View full-size slide

  31. When to use Dapr?
    36

    View full-size slide

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

    View full-size slide

  33. Greenfield projects: postpone
    your architecture decisions.
    38

    View full-size slide

  34. When not to use Dapr?
    39

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  37. 42
    Service
    invocation
    Checkout
    Order
    processor
    POST

    View full-size slide

  38. 43
    Publish &
    subscribe
    Checkout
    Order
    processor

    View full-size slide

  39. 44
    State
    Management
    Redis
    Order
    processor

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide