Portable Multi-cloud Applications with Dapr.pdf

nileshgule 23 views 21 slides Sep 24, 2024
Slide 1
Slide 1 of 21
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21

About This Presentation

Slide deck used during the Azure Builders meetup in melbourne on 24 Septmeber 2024


Slide Content

Portable
Multi-cloud Apps
with
Dapr
Nilesh Gule @nileshgule

$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”,
}

TechTalks Application Architecture –Without Dapr
TechTalks ConsumerTechTalks Producer
Message Broker

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

Dapr overview

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

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

@nileshgule
Let the messages flow

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

Dapr Kubernetes cluster

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

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 – Flaticonhttps://www.flaticon.com/free-icons/

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<ResponseEntity> consumeMessage(@RequestBody(required = false)
CloudEvent<TechTalk> 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 – Flaticonhttps://www.flaticon.com/free-icons/

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 – Flaticonhttps://www.flaticon.com/free-icons/

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

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

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

Dapr Demo Resources
https: //g ithub. com/NileshGule/cloud-na tiv e-ninja
Cloud Native Ninja GitHub repo: https://github.com/NileshGule/cloud-native-ninja
Slides
https: //www. slidesha re. net/nileshg ule/
Slideshare: https://www.slideshare.net/nileshgule/
https: //spea k erdeck . com/nileshg ule/
Speaker Deck: https://speakerdeck.com/nileshgule/
https: //g ithub. com/NileshGule/techta lk s-a zure-conta iner-a pps-demo
Azure container Apps repo: https://github.com/NileshGule/techtalks-azure-container-apps-demo
https: //g ithub. com/NileshGule/pd-tech-fest-2019
Initial version without Daprrepo: https://github.com/NileshGule/pd-tech-fest-2019

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

Q&A