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

Cloud-Native Microservices für alle: On-Premise...

Cloud-Native Microservices für alle: On-Premises oder Cloud - mit Dapr

Microservices-all-the-things! Jaja, wir haben es gehört. Lassen Sie uns in dieser Session über pragmatische Wege zum Entwerfen und Implementieren servicebasierter Architekturen sprechen, die mitunter über die reinen „By-the-book“-Ansätze hinausgehen. Mit der beispielhaften, aber kritischen Verwendung der Open-Source-Lösung Dapr zeigt Christian Weyer, wie man durch Nutzung bewährter Cloud-Native Design Patterns primär Zeit auf das Implementieren von Features & Geschäftslogik konzentrieren kann und nicht auf die Infrastruktur drum herum. Sehen Sie auch, wie [Micro-]Services in einem Spektrum von Ausführungsumgebungen betrieben werden können, von selbst gehosteten lokalen Umgebungen bis hin zu supercoolem serverlosem Azure.
60 Minuten für eine kritische und pragmatische Sicht auf die anhaltende Microservices-Diskussion.

Christian Weyer

July 20, 2022
Tweet

More Decks by Christian Weyer

Other Decks in Programming

Transcript

  1. Cloud-Native Microservices für alle: On-Premises oder Cloud - mit Dapr

    Christian Weyer https://thinktecture.com/christian-weyer @christianweyer Co-Founder & CTO
  2. § Co-Founder & CTO at Thinktecture AG § Personal focus

    on § Cloud-native & serverless architectures § Pragmatic end-to-end solutions § Mobile & web-based application architectures § Independent Microsoft Regional Director § Microsoft MVP for Developer Technologies & Azure ASPInsider, AzureInsider § Google GDE for Web Technologies [email protected] @christianweyer https://www.thinktecture.com Christian Weyer On-Premises oder Cloud - mit Dapr Cloud-Native Microservices für alle 2
  3. § Microservices - revisited § Cloud-native applications § Dapr §

    Basics § Components § Cloud-native building blocks § Hosting - on-premsies & Cloud § Recap § Q&A Agenda Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr 3
  4. Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr

    Three themes Right Thing Right Focus Right Place 4
  5. Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr

    Three themes Right Thing Right Focus Right Place 5
  6. § Docker § Kubernetes § Azure § Serverless § NoSQL

    § Service Fabric § Dapr § gRPC § … no more than 20 lines of code per service … § … further BS … Microservices do not mean… Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr 10
  7. § … implement domain boundaries based on business capabilities &

    data § This is not a technical thing § This is a very hard job to do right § No programming language or framework helps here § … are subject to & influence organization structure (teams etc.) § Conway’s law § … are just one style of architecture § We can mix and match § We can – and should! - be pragmatic to choose Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr Microservices … 11
  8. Single Responsibility § Focused on business domain § ‘Small’ Isolation

    § Well-defined, technology-agnostic API § Possible choice of technology § ‘Mobility’ Autonomy § Exclusive state (data storage) § Isolated build and deployment § ‘Team’ Decoupling § Asynchronous communication (Really, always!?) Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr Central principles of Microservices 12 P
  9. § Let’s not talk about Microservices – but about Cloud-native

    applications § These may be microservices § Built with aspects in mind to be able to run them in the Cloud § But should be runnable anywhere § Typical attributes for architectures and applications – on a use-case-based spectrum § Configurability § Resiliency § Availability § Scalability § Observability Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr Cloud-native applications 14
  10. Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr

    Sample Cloud-Native application scenario – with Dapr (original sketch 😇) 15
  11. § Execution independence / Hosting-agnostic § Different programming / tech

    stacks § Running anywhere § Resiliency § Location transparency § Error handling, retries § Decoupling § Robustness § Async business processes § Observability § Seeing everything end-to- end § Tracing, logging, metrics ➡ Would be nice to have some help here § Proven patterns § By hand – OR Library, SDK, runtime? Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr Cloud-native applications: Some tedious parts 16
  12. Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr

    Three themes Right Thing Right Focus Right Place 17
  13. § Portable, event-driven runtime for building distributed applications across Cloud

    and edge § Open-source, community-driven, vendor-neutral § Best practices building blocks § Consistent, portable, open APIs § Extensible & pluggable components § Adopt standards § Platform-agnostic for edge and Cloud § Any language and framework Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr Dapr: Distributed Application Runtime – for Cloud-native applications 19 https://dapr.io/
  14. • Dapr bets on sidecar architecture • “Not your concern!”

    • daprd will do this • Talk to sidecar • Use HTTP or gRPC • Use an SDK Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr Sidecar pattern: separating concerns 21 My App Dapr API POST http://localhost:3500/v1.0/invoke/cart/method/neworder GET http://localhost:3500/v1.0/state/inventory/item67 POST http://localhost:3500/v1.0/publish/shipping/orders GET http://localhost:3500/v1.0/secrets/keyvault/password HTTP/gRPC Application Sidecar
  15. Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr

    Dapr applications: utilizing platform features 22 Service A Observability Bindings & Triggers State Management Secret Management PubSub Messaging Virtual Actors Service Invocation Service B My App
  16. Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr

    Dapr components 23 My App Observability Prometheus AppInsights Jaeger Zipkin Bindings & Triggers State Stores Secret Stores PubSub Brokers https://github.com/dapr/components-contrib
  17. § Dapr CLI § Can be integrated into any IDE

    § Focus on Dapr infrastructure aspects § Docker containers for infra- sturcture components § Runtime config via YAML files § Config § Components § Etc. Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr Getting started with Dapr 24
  18. § Discover and invoke methods on services § Call services

    securely with encryption and apply access control on the methods § Handle retries and transient errors § Use tracing to see call graph with metrics to diagnose issues in production Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr Service invocation 27
  19. § Each app/service needs an ID § Sidecars talk to

    each other Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr Service invocation 28 Service A My App mDNS Multicast DNS component for service discovery mTLS encryption POST http://localhost:3500/v1.0/invoke/servicea/method/neworder {"data":"Hello World"} POST http://10.0.0.2:8000/neworder {"data":"Hello World"}
  20. Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr

    Input triggers 29 My App Twitter POST http://10.0.0.2:8000/newtweet {"data":“📢 We are excited to announce the …"}
  21. Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr

    Output bindings 30 My App Twilio POST http://localhost:3500/v1.0/bindings/twilio {"data":"Hello World"} Hello World
  22. Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr

    Sample Cloud-Native application scenario – with Dapr 31
  23. § At-least-once semantics for message delivery Cloud-Native Microservices für alle

    On-Premises oder Cloud - mit Dapr Publish & subscribe 32 Service B My App Redis Cache Service A POST http://localhost:3500/v1.0/publish/orders/processed {"data":"Hello World"} POST http://10.0.0.2:8000/orders http://10.0.0.4:8000/factory/orders {"data":"Hello World"}
  24. Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr

    Observability 33 OpenTelemetry collector Logging & tracing extensions My App Redis Cache Twitter Service B Service A
  25. Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr

    Three themes Right Thing Right Focus Right Place 34
  26. § Self-hosted § dapr run all your services § Infrastructure

    services can be run in Docker (mixed mode) § Docker Compose § Everything running in Docker, on-prem § Lightweight orchestration § Kubernetes § Full power of k8s orchestration § On-prem or in Cloud (any Cloud) § Azure Container Apps § Dapr built-in § Fixed version Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr Hosting anywhere 36
  27. Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr

    Three themes Right Thing Right Focus Right Place 38
  28. § Cloud-native applications can be very complex § Need to

    elimainate parts of the complexity § Choose wisely – be pragmatic § LOLA: sometimes abstractions just leak § E.g., different pub-sub systems behave differently in semantics § E.g.: State management building block § Limited use cases § Key/value API - no relational or graph storage § Custom API for querying § IMHO: too much of an abstraction Cloud-Native Microservices für alle On-Premises oder Cloud - mit Dapr Dapr-all-the-things? 39
  29. Recap Cloud-Native Microservices für alle On-Premises oder Cloud - mit

    Dapr 40 YOU need to choose: Dapr abstraction or not Modern applications need to be Cloud- native Microservices are just one architecture style (and more) Dapr 😀 § Encapsulates proven patterns in building blocks § Pluggable components § Language-agnostic § Host-agnostic Reminder: No technology, framework, runtime can solve business domain problems Dapr 🤔 § Some features seem incomplete § Docs and samples need to be improved § Might be overhead for you
  30. Thank you! Christian Weyer https://thinktecture.com/christian-weyer @christianweyer [email protected] Demo: https://github.com/thinktecture/dapr-basics-demos Cloud-Native

    @Thinktecture https://www.thinktecture.com/technologien/cloud-native/ Articles about Blazor, PWA, Web Components, Angular, .NET Core & more https://www.thinktecture.com/newsletter 41