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

Dapr: Dinosaur or Developer's Dream? (JConf.dev)

Dapr: Dinosaur or Developer's Dream? (JConf.dev)

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

September 29, 2022
Tweet

More Decks by Maarten Mulders

Other Decks in Technology

Transcript

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

  2. COMPLEXITY.... COMPLEXITY.... COMPLEXITY.... COMPLEXITY.... COMPLEXITY.... ESSENTIAL ESSENTIAL ESSENTIAL ESSENTIAL ESSENTIAL

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

  4. #dapr Maarten Mulders (@mthmulders)

  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)
  6. ...if only there were a standardised API for that! #dapr

    Maarten Mulders (@mthmulders)
  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)
  8. #dapr Maarten Mulders (@mthmulders)

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

  10. DISTRIBUTED APPLICATION RUNTIME “ An event-driven, portable runtime for building

    microservices on cloud and edge. #dapr Maarten Mulders (@mthmulders)
  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)
  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)
  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\" }" } ] HTTP/1.1 204 No Content #dapr Maarten Mulders (@mthmulders)
  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)
  15. #dapr Maarten Mulders (@mthmulders)

  16. #dapr Maarten Mulders (@mthmulders)

  17. #dapr Maarten Mulders (@mthmulders)

  18. SERVICE MESH ON STEROIDS SERVICE MESH ON STEROIDS SERVICE MESH

    ON STEROIDS SERVICE MESH ON STEROIDS SERVICE MESH ON STEROIDS “ “ “ “ “ Service Mesh for PaaS Service Mesh for PaaS Service Mesh for PaaS Service Mesh for PaaS Service Mesh for PaaS -- -- -- -- -- @rmehmandarov @rmehmandarov @rmehmandarov @rmehmandarov @rmehmandarov #dapr Maarten Mulders (@mthmulders)
  19. DEMO: KEY/VALUE STORE #dapr Maarten Mulders (@mthmulders)

  20. #dapr Maarten Mulders (@mthmulders)

  21. #dapr Maarten Mulders (@mthmulders)

  22. 🤞🏻 🤞🏻 🤞🏻 🤞🏻 🤞🏻 1. Start the Dapr sidecar

    2. Start the demo app 3. Store / retrieve data #dapr Maarten Mulders (@mthmulders)
  23. COMPONENTS COMPONENTS COMPONENTS COMPONENTS COMPONENTS #dapr Maarten Mulders (@mthmulders)

  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)
  25. SERVICE INVOCATION SERVICE INVOCATION SERVICE INVOCATION SERVICE INVOCATION SERVICE INVOCATION

    #dapr Maarten Mulders (@mthmulders)
  26. PUB/SUB PUB/SUB PUB/SUB PUB/SUB PUB/SUB #dapr Maarten Mulders (@mthmulders)

  27. BINDINGS BINDINGS BINDINGS BINDINGS BINDINGS #dapr Maarten Mulders (@mthmulders)

  28. SECRETS SECRETS SECRETS SECRETS SECRETS #dapr Maarten Mulders (@mthmulders)

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

  30. #dapr Maarten Mulders (@mthmulders)

  31. 🤞🏻 🤞🏻 🤞🏻 🤞🏻 🤞🏻 1. Start the Dapr sidecar

    2. Start the demo apps 3. Simulate traffic 🚗 4. Receive speeding ticket 😱 #dapr Maarten Mulders (@mthmulders)
  32. OBSERVABILITY OBSERVABILITY OBSERVABILITY OBSERVABILITY OBSERVABILITY TRACING TRACING TRACING TRACING TRACING

    METRICS METRICS METRICS METRICS METRICS #dapr Maarten Mulders (@mthmulders)
  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)
  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)
  35. METRICS Dapr exposes metrics about its own processes, such as:

    resource usage mTLS (certificate issuing) sidecar operations #dapr Maarten Mulders (@mthmulders)
  36. METRICS #dapr Maarten Mulders (@mthmulders)

  37. TRACING WITH DAPR SIDECAR POST /v1.0/invoke/vehicleregistrationservice/method/vehicleinfo/YH-52-VD Host: localhost:3500 Content-Type: application/json

    X-DaprRequestId: b237d1da-beaa-42ef-b8c6-fcf38a900a21 ... (omitted for brevity) #dapr Maarten Mulders (@mthmulders)
  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)
  39. THE DAPR SDK FOR JAVA Using io.dapr:dapr-sdk-springboot @Topic(name = "speedingviolations",

    pubsubName = "pubsub") @PostMapping(path = "/collectfine") public ResponseEntity<Void> registerViolation( @RequestBody CloudEvent<SpeedingViolation> event ) { // ... } #dapr Maarten Mulders (@mthmulders)
  40. OBSERVABILITY OBSERVABILITY OBSERVABILITY OBSERVABILITY OBSERVABILITY 🤞🏻 🤞🏻 🤞🏻 🤞🏻 🤞🏻

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

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

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