Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Portable multi-cloud apps using Dapr

Nilesh Gule
September 23, 2024

Portable multi-cloud apps using Dapr

Slide decks used during the Azure Builders meetup in Melbourne on 24 September 2024

Nilesh Gule

September 23, 2024
Tweet

More Decks by Nilesh Gule

Other Decks in Technology

Transcript

  1. $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”, }
  2. 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
  3. TechTalks Application Architecture – with Dapr TechTalks Consumer TechTalks Producer

    TechTalks Frontend (UI) Message Broker Polyglot Programming
  4. 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/
  5. 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 – Flaticon https://www.flaticon.com/free-icons/
  6. 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/
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. Q&A