Slide 1

Slide 1 text

Portable Multi-cloud Apps with Dapr Nilesh Gule @nileshgule

Slide 2

Slide 2 text

$whoami { “name” : “Nilesh Gule”, “website” : “https://www.HandsOnArchitect.com", “github” : “https://GitHub.com/NileshGule" “twitter” : “@nileshgule”, “linkedin” : “https://www.linkedin.com/in/nileshgule”, “YouTube” : “https://www.YouTube.com/@nilesh-gule” “likes” : “Technical Evangelism, Cricket”, }

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

TechTalks Application Architecture – Without Dapr TechTalks Consumer TechTalks Producer Message Broker

Slide 5

Slide 5 text

Features of Cloud Native Apps Containerized Lightweight, self-contained Scalable Cost optimized to run with right sized resources Automation Automates everything CI CD, Infrastructure as Code (IaC), GitOps API driven Loosely coupled, integrates using open standards Resilient Self healing, recovers faster from failure Microservices Purpose driven modular components

Slide 6

Slide 6 text

Dapr overview

Slide 7

Slide 7 text

TechTalks Application Architecture – with Dapr TechTalks Consumer TechTalks Producer TechTalks Frontend (UI) Message Broker Polyglot Programming

Slide 8

Slide 8 text

@nileshgule Techtalks-producer aci-dev-env azure-container-app-rg ngacrregistry acrResourceGroup Techtalks-consumer Azure Container Apps - TechTalks with Dapr

Slide 9

Slide 9 text

@nileshgule Let the messages flow

Slide 10

Slide 10 text

Techtalks-producer demo-azure-melbourne-rg ngacrregistry acrResourceGroup Techtalks-consumer Azure Kubernetes Service - TechTalks with Dapr

Slide 11

Slide 11 text

Dapr Kubernetes cluster

Slide 12

Slide 12 text

Dapr Components https://docs.dapr.io/concepts/components-concept/#built-in-and-pluggable-components

Slide 13

Slide 13 text

client.PublishEventAsync(pubsubName, topicName, talk, cancellationToken); app.UseCloudEvents(); app.UseCloudEvents(); app.MapSubscribeHandler(); app.MapPost("/process", ([FromBody] TechTalk techTalk) => }).WithTopic("rabbitmq-pubsub", "techtalks") icons created by smashingstocks – Flaticon https://www.flaticon.com/free-icons/

Slide 14

Slide 14 text

client.publishEvent("rabbitmq-pubsub", "techtalks", techTalk, singletonMap(Metadata.TTL_IN_SECONDS, MESSAGE_TTL_IN_SECONDS)).block(); @Topic(pubsubName="rabbitmq-pubsub", name="techtalks") @PostMapping(path = "/process", consumes = MediaType.ALL_VALUE) public Mono consumeMessage(@RequestBody(required = false) CloudEvent cloudEvent) { return Mono.fromSupplier(() -> { try { TimeUnit.MILLISECONDS.sleep(250); TechTalk techtalk = cloudEvent.getData(); logTechTalkDetails(techtalk); return ResponseEntity.ok("SUCCESS"); } catch (Exception e) { throw new RuntimeException(e); } }); } icons created by smashingstocks – Flaticon https://www.flaticon.com/free-icons/

Slide 15

Slide 15 text

client.PublishEvent(ctx, pubsubComponentName, pubsubTopic, techTalk); var sub = &common.Subscription{ PubsubName: "rabbitmq-pubsub", Topic: "techtalks", Route: "/techtalks", } s := daprd.NewService(":" + appPort) err := s.AddTopicEventHandler(sub, eventHandler) icons created by smashingstocks – Flaticon https://www.flaticon.com/free-icons/

Slide 16

Slide 16 text

Why use Dapr • Any language, any framework, anywhere • Building blocks for cloud and edge • Multiple hosting environments • Language specific SDKs • C++, Go, Java, JavaScript, .NET, PHP, Python, Rust • Frameworks • ASP.NET Core, Spring Boot , Flask, Express • Designed for operations

Slide 17

Slide 17 text

Summary Key benefits of Dapr • Dapr tries to simplify the Microservices development and deployment • Dapr Components help to extract underlying functionality and provides abstractions • Best practices related to cloud native applications • Build portable app to deploy on local laptop, public cloud (Azure / AWS), Private Cloud / PaaS (OpenShift), Hybrid cloud, multi cloud scenarios etc. • Make app portable to run in serverless as well as managed cloud services • Implement observability features to monitor apps

Slide 18

Slide 18 text

References https://www.youtube.com/@nilesh-gule https://dapr.io/ Dapr Publish and Subscribe Dapr Secrets management Dapr on Kubernetes Dapr in local environment Dapr Quickstarts Serverless - Dapr and Azure Container Apps

Slide 19

Slide 19 text

Dapr Demo Resources https://github.com/NileshGule/cloud-native-ninja Cloud Native Ninja GitHub repo: https://github.com/NileshGule/cloud-native-ninja Slides https://www.slideshare.net/nileshgule/ Slideshare: https://www.slideshare.net/nileshgule/ https://speakerdeck.com/nileshgule/ Speaker Deck: https://speakerdeck.com/nileshgule/ https://github.com/NileshGule/techtalks-azure-container-apps-demo Azure container Apps repo: https://github.com/NileshGule/techtalks-azure-container-apps-demo https://github.com/NileshGule/pd-tech-fest-2019 Initial version without Dapr repo: https://github.com/NileshGule/pd-tech-fest-2019

Slide 20

Slide 20 text

Nilesh Gule ARCHITECT | MICROSOFT MVP “Code with Passion and Strive for Excellence” nileshgule @nileshgule Nilesh Gule NileshGule www.handsonarchitect.com https://www.youtube.com/@nilesh-gule

Slide 21

Slide 21 text

Q&A