$30 off During Our Annual Pro Sale. View Details »

Dapr: Dinosaur or Developer's Dream? (JBCNConf)

Dapr: Dinosaur or Developer's Dream? (JBCNConf)

Recently, the Dapr community released Dapr into the wild, aiming to simplify cloud-native application development. Dapr lets you abstract your distributed architecture from the underlying infrastructure that powers it. Forget about Kafka, RabbitMQ or any cloud-specific product: you're talking with a pub/sub broker. Let Dapr take care of how it works. Want to switch later? Sure, no problem!

So, is Dapr the new J2EE application server? How could it change the way we develop distributed solutions? Join me in this talk to find out if we're looking at a dinosaur in a fancy suit, or a developer's dream.

Maarten Mulders

July 19, 2022
Tweet

More Decks by Maarten Mulders

Other Decks in Technology

Transcript

  1. DAPR
    DINOSAUR OR

    DEVELOPER'S DREAM?
    #dapr Maarten Mulders (@mthmulders)

    View Slide























  2. Please share on Twitter and tag and tag
    @edwinderks @teobais_
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  3. COMPLEXITY....
    COMPLEXITY....
    COMPLEXITY....
    COMPLEXITY....
    COMPLEXITY....
    ESSENTIAL
    ESSENTIAL
    ESSENTIAL
    ESSENTIAL
    ESSENTIAL
    ACCIDENTAL
    ACCIDENTAL
    ACCIDENTAL
    ACCIDENTAL
    ACCIDENTAL
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  4. #dapr Maarten Mulders (@mthmulders)

    View Slide



















  5. “
    “
    “
    “
    “
    Architecture is about making choices.
    But not
    Architecture is about making choices.
    But not
    Architecture is about making choices.
    But not
    Architecture is about making choices.
    But not
    Architecture is about making choices.
    But not
    too soon - later is better.
    too soon - later is better.
    too soon - later is better.
    too soon - later is better.
    too soon - later is better.
    #dapr Maarten Mulders (@mthmulders)

    View Slide





















  6. ...if only there were a

    standardised API for that!
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  7. HERE BE DINOSAURS?!
    (Source: , December 2003,
    retrieved September 2021)
    “
    J2EE has emerged, since it was first released in
    1999, as an integrated standard for
    implementing and deploying portable, multi-
    tiered enterprise applications
    The All New J2EE 1.4 Platform
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  8. #dapr Maarten Mulders (@mthmulders)

    View Slide

  9. Can't this be a little simpler...?
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  10. DISTRIBUTED
    APPLICATION RUNTIME
    “
    An event-driven, portable runtime for building
    microservices on cloud and edge.
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  11. INGREDIENTS
    (or: Buzzword Bingo)
    Open Source
    Polyglot
    Modular
    Pluggable
    Cloud-Native
    warning: may contain traces of nuts, gluten and other allergens.
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  12. BUILDING BLOCK
    Describe cross-cutting concerns for building distributed systems,
    e.g.
    “
    my application needs to store data as key/value
    pairs
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  13. BUILDING BLOCK API
    POST /v1.0/state/vehicles HTTP/1.1

    Host: localhost:3500

    Content-Type: application/json



    [

    { "key": "YH-52-VD",

    "value": "{\"licenseNumber\":\"YH-52-VD\",

    \"entryTimestamp\":\"2021-09-15T11:19:18\" }"

    }

    ]



    #dapr Maarten Mulders (@mthmulders)

    View Slide

  14. BUILDING BLOCK API
    GET /v1.0/state/vehicles/YH-52-VD HTTP/1.1

    Host: localhost:3500

    Accept: application/json



    HTTP/1.1 200 OK

    Content-Type: application/json



    "{

    \"licenseNumber\":\"YH-52-VD\",
    \"entryTimestamp\":\"2021-09-15T11:19:18.1781609\"

    }"

    #dapr Maarten Mulders (@mthmulders)

    View Slide

  15. #dapr Maarten Mulders (@mthmulders)

    View Slide

  16. #dapr Maarten Mulders (@mthmulders)

    View Slide

  17. #dapr Maarten Mulders (@mthmulders)

    View Slide

  18. SERVICE MESH ON STEROIDS
    SERVICE MESH ON STEROIDS
    SERVICE MESH ON STEROIDS
    SERVICE MESH ON STEROIDS
    SERVICE MESH ON STEROIDS
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  19. DEMO: KEY/VALUE
    STORE
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  20. #dapr Maarten Mulders (@mthmulders)

    View Slide

  21. #dapr Maarten Mulders (@mthmulders)

    View Slide

  22. 🤞🏻
    🤞🏻
    🤞🏻
    🤞🏻
    🤞🏻
    1. Start the Dapr sidecar
    2. Start the demo app
    3. Store / retrieve data
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  23. COMPONENTS
    COMPONENTS
    COMPONENTS
    COMPONENTS
    COMPONENTS
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  24. 1. State Store — key/value storage
    2. Service Invocation — invoke remote methods
    3. Pub/Sub — async message processing
    4. Bindings — interfaces to/from external integrations
    5. Secrets — various secret stores
    6. Name resolution — name resolution for service invocation
    7. Middleware — various filters on incoming Web requests




    Over 27 implementations available!
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  25. SERVICE INVOCATION
    SERVICE INVOCATION
    SERVICE INVOCATION
    SERVICE INVOCATION
    SERVICE INVOCATION






















    #dapr Maarten Mulders (@mthmulders)

    View Slide

  26. PUB/SUB
    PUB/SUB
    PUB/SUB
    PUB/SUB
    PUB/SUB






















    #dapr Maarten Mulders (@mthmulders)

    View Slide

  27. BINDINGS
    BINDINGS
    BINDINGS
    BINDINGS
    BINDINGS






















    #dapr Maarten Mulders (@mthmulders)

    View Slide

  28. SECRETS
    SECRETS
    SECRETS
    SECRETS
    SECRETS






















    #dapr Maarten Mulders (@mthmulders)

    View Slide

  29. DEMO: SERVICE
    INVOCATION & OUTPUT
    BINDINGS
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  30. #dapr Maarten Mulders (@mthmulders)

    View Slide

  31. 🤞🏻
    🤞🏻
    🤞🏻
    🤞🏻
    🤞🏻
    1. Start the Dapr sidecar
    2. Start the demo apps
    3. Simulate traffic
    🚗
    4. Receive speeding ticket
    😱
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  32. OBSERVABILITY
    OBSERVABILITY
    OBSERVABILITY
    OBSERVABILITY
    OBSERVABILITY
    TRACING
    TRACING
    TRACING
    TRACING
    TRACING
    METRICS
    METRICS
    METRICS
    METRICS
    METRICS
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  33. TRACING
    Inject custom headers (e.g. X-B3-TraceId and X-B3-SpanId) to
    measure execution throughout a chain.
    Zipkin collects those traces and provides visualisations.
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  34. METRICS
    Application records metrics (numeric measurements)
    Prometheus collects (scrapes) measurements → time series
    Grafana hosts dashboards to visualise the time series
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  35. METRICS
    Dapr exposes metrics about its own processes, such as:
    resource usage
    mTLS (certificate issuing)
    sidecar operations
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  36. METRICS
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  37. TRACING WITH DAPR SIDECAR
    POST /v1.0/invoke/vehicleregistrationservice/method/v
    Host: localhost:3500

    Content-Type: application/json

    X-DaprRequestId: b237d1da-beaa-42ef-b8c6-fcf38a900a21


    ... (omitted for brevity)

    #dapr Maarten Mulders (@mthmulders)

    View Slide

  38. THE DAPR SDK FOR JAVA
    Using io.dapr:dapr-sdk
    daprClient.invokeMethod(

    "vehicleregistrationservice",

    "vehicleinfo/" + licenseNumber,

    null, // no request body

    HttpExtension.GET, VehicleInfo.class

    ).contextWrite(

    /*

    * add tracing context from

    * e.g. OpenTracing or Spring Sleuth

    */

    );

    #dapr Maarten Mulders (@mthmulders)

    View Slide

  39. THE DAPR SDK FOR JAVA
    Using io.dapr:dapr-sdk-springboot
    @Topic(name = "speedingviolations", pubsubName = "pub
    @PostMapping(path = "/collectfine")

    public ResponseEntity registerViolation(

    @RequestBody CloudEvent event

    ) {

    // ...

    }

    #dapr Maarten Mulders (@mthmulders)

    View Slide

  40. OBSERVABILITY
    OBSERVABILITY
    OBSERVABILITY
    OBSERVABILITY
    OBSERVABILITY
    🤞🏻
    🤞🏻
    🤞🏻
    🤞🏻
    🤞🏻
    1. Show Zipkin traces
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  41. DINOSAUR OR
    DEVELOPER'S DREAM?
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  42. DINOSAUR?
    BUSTED
    DEVELOPER'S DREAM?
    BUSTED
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  43. DAPR — TAKE AWAYS
    1. Building blocks for distributed application integration patterns
    2. The sidecar brings you to places you've never been before
    3. Not a one-stop shop or Swiss army knife








    DIY Workshop: https://bit.ly/dapr-workshop-
    java
    #dapr Maarten Mulders (@mthmulders)

    View Slide

  44. IMAGE ATTRIBUTIONS
    electronic circuit board -
    infrastructure -
    SPECS-speed camera in Utrecht, The Netherlands -
    lego -
    airplane cockpit -
    https://pxhere.com/en/photo/941067
    https://pxhere.com/en/photo/1534169
    https://commons.wikimedia.org/wiki/File:Trajectcontrole.jpg
    https://pxhere.com/en/photo/1121211
    https://pxhere.com/en/photo/609377
    #dapr Maarten Mulders (@mthmulders)

    View Slide