Slide 1

Slide 1 text

Mauricio Salatino & Thomas Vitale Spring I/O Barcelona May 30th, 2024 Dapr and Spring Boot Solving the Challenges of Distributed Systems @vitalethomas @salaboy

Slide 2

Slide 2 text

Challenges That you will phase Distributed Systems are complex Developer Productivity Su ff ers writing YAML Teams Expertise to a whole new level @salaboy @vitalethomas https://www.diagrid.io/blog/dapr-for-spring-boot

Slide 3

Slide 3 text

Let’s Start with a Demo Based on https://github.com/dockersamples/example-voting-app @salaboy @vitalethomas

Slide 4

Slide 4 text

Demo @salaboy @vitalethomas https://diagrid.ws/vote

Slide 5

Slide 5 text

diagrid.io • Software Engineer and CNCF Ambassador. • Author of “Platform Engineering on Kubernetes” (Manning). • @DaprDev @KnativeProject @KeptnProject Mauricio Salatino salaboy.com @Salaboy

Slide 6

Slide 6 text

Systematic • Software Engineer • CNCF Ambassador, Oracle ACE Pro, Testcontainers Community Champion • Author of “Cloud Native Spring in Action” (Manning). • OSS contributor (Java, Spring, Cloud Native Technologies) Thomas Vitale thomasvitale.com @vitalethomas

Slide 7

Slide 7 text

Where is the application deployed? What is a Cloud-Native Runtime? @salaboy @vitalethomas

Slide 8

Slide 8 text

Where is the application deployed? Is it Kubernetes? @salaboy @vitalethomas ?

Slide 9

Slide 9 text

Where is the application deployed? Or Cloud Services? @salaboy @vitalethomas ? ?

Slide 10

Slide 10 text

Most likely you are using containers @salaboy @vitalethomas

Slide 11

Slide 11 text

Most likely you are using OCI containers @salaboy @vitalethomas

Slide 12

Slide 12 text

Containers save time @salaboy @vitalethomas

Slide 13

Slide 13 text

Shoutout to Testcontainers @salaboy @vitalethomas

Slide 14

Slide 14 text

If you look deeper @salaboy @vitalethomas

Slide 15

Slide 15 text

In a cloud native runtime @salaboy @vitalethomas

Slide 16

Slide 16 text

In a cloud native runtime @salaboy @vitalethomas

Slide 17

Slide 17 text

To make it more complicated… @salaboy @vitalethomas

Slide 18

Slide 18 text

Dapr, can we delegate more responsibility to our cloud native runtime? @salaboy @vitalethomas

Slide 19

Slide 19 text

Dapr - Distributed Application Runtime @salaboy @vitalethomas

Slide 20

Slide 20 text

How does it works? @salaboy @vitalethomas

Slide 21

Slide 21 text

How does it works? @salaboy @vitalethomas

Slide 22

Slide 22 text

How does it works? @salaboy @vitalethomas

Slide 23

Slide 23 text

How does it works? @salaboy @vitalethomas

Slide 24

Slide 24 text

But if you can do that.. you can also do this @salaboy @vitalethomas

Slide 25

Slide 25 text

But if you can do that.. you can also do this @salaboy @vitalethomas

Slide 26

Slide 26 text

How does it works? @salaboy @vitalethomas

Slide 27

Slide 27 text

How does it works? @salaboy @vitalethomas

Slide 28

Slide 28 text

How does it works? @salaboy @vitalethomas

Slide 29

Slide 29 text

What about local development? I don’t want to deploy to Kubernetes… @salaboy @vitalethomas

Slide 30

Slide 30 text

Without Kubernetes (with Testcontainers) @salaboy @vitalethomas

Slide 31

Slide 31 text

Let’s do some live coding… @salaboy @vitalethomas

Slide 32

Slide 32 text

This is good … But can we make it more Bootiful? @salaboy @vitalethomas

Slide 33

Slide 33 text

How do we do this in Spring? Spring Data -> https://github.com/spring-projects/spring-data-keyvalue @salaboy @vitalethomas

Slide 34

Slide 34 text

How do we do this in Spring? Spring Data -> https://github.com/spring-projects/spring-data-keyvalue @salaboy @vitalethomas

Slide 35

Slide 35 text

How do we do this in Spring? Spring Kafka -> https://github.com/spring-projects/spring-kafka @salaboy @vitalethomas

Slide 36

Slide 36 text

How do we do this in Spring? Spring Pulsar -> https://github.com/spring-projects/spring-pulsar @salaboy @vitalethomas

Slide 37

Slide 37 text

How do we do this in Spring? Spring AMQP (RabbitMQ) @salaboy @vitalethomas

Slide 38

Slide 38 text

To provide a better integration we did the same for Dapr @salaboy @vitalethomas

Slide 39

Slide 39 text

(Show application code) @salaboy @vitalethomas

Slide 40

Slide 40 text

But there is more @salaboy @vitalethomas

Slide 41

Slide 41 text

Outbox Pattern * Produce an event every time we store some data * Do it transactionally * If for some reason storing data fails, 
 the event shouldn’t be produced @salaboy @vitalethomas

Slide 42

Slide 42 text

Durable Exections / Workflows * Sometimes we need more than just calling X services in a sequence * We want to make sure that: * If things fail we have a backup plan like: custom retries, circuit breakers and domain-speci fi c logic hooks * Support for long running and stateful interactions, for example waiting for a human input that might be on holidays * That we have compensation logic to undo operations @salaboy @vitalethomas

Slide 43

Slide 43 text

Let’s raffle some books! @salaboy @vitalethomas

Slide 44

Slide 44 text

Deployment @salaboy @vitalethomas

Slide 45

Slide 45 text

What about Deployments? The platform team takes care of wiring up the available infrastructure @salaboy @vitalethomas

Slide 46

Slide 46 text

Thanks @vitalethomas / @salaboy @salaboy @vitalethomas https://www.diagrid.io/blog/dapr-for-spring-boot