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

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

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

Microservices-all-the-things – haben wir oft genug gehört. Lassen Sie uns in diesem Talk über pragmatische Wege zum Umsetzen servicebasierter Architekturen sprechen, die modernen Cloud-Native-Ansätzen genügen. Mit der beispielhaften Verwendung von Dapr als Open-Source-Laufzeitumgebung und Framework zeigt Christian Weyer, wie Sie Ihre Zeit und Ihr Hauptaugenmerk auf das Schreiben von Funktionalität und Geschäftslogik konzentrieren können, nicht auf die Infrastruktur drumherum. Und das für so gut wie jede Programmiersprache. Zu guter Letzt erfahren Sie, wie Sie Ihre [Micro-]Services in einem Spektrum von Ausführungsumgebungen laufen lassen, von selbst gehosteten lokalen Umgebungen bis hin zur Public Cloud.

Christian Weyer

October 13, 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

    View full-size slide

  2. § 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
    Cloud-Native Microservices für alle:
    On-Premises oder Cloud – mit Dapr
    Christian Weyer
    Co-Founder & CTO @ Thinktecture AG
    2

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  5. 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
    Decoupling
    § Asynchronous communication
    (Really, always!?)
    Cloud-Native Microservices für alle:
    On-Premises oder Cloud – mit Dapr
    Central Principles of Microservices
    5

    View full-size slide

  6. § … 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 chose
    Cloud-Native Microservices für alle:
    On-Premises oder Cloud – mit Dapr
    Microservices …
    6

    View full-size slide

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

    View full-size slide

  8. § 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
    Cloud-Native Microservices für alle:
    On-Premises oder Cloud – mit Dapr
    Cloud-Native applications
    8

    View full-size slide

  9. Cloud-Native Microservices für alle:
    On-Premises oder Cloud – mit Dapr
    9
    Availability
    Scalability
    Resilience
    Configurability
    Observability
    Cloud-Native
    Applications

    View full-size slide

  10. Cloud-Native Microservices für alle:
    On-Premises oder Cloud – mit Dapr
    Sample application scenario
    10

    View full-size slide

  11. § Resiliency
    § Location transparency
    § Error handling, retries
    § Decoupling
    § Robustness through messaging
    § Async business processes
    § Execution independence
    § Different programming /
    tech stacks
    § Running anywhere
    § Observability
    § Seeing everything
    end-to-end
    § Tracing, logging, metrics
    💡 Nice to have help here
    § Proven patterns
    § Support by a runtime
    (with SDK)
    Cloud-Native Microservices für alle:
    On-Premises oder Cloud – mit Dapr
    Cloud-Native applications - some tedious parts
    11

    View full-size slide

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

    View full-size slide

  13. Dapr
    Basics
    Cloud-Native Microservices für alle:
    On-Premises oder Cloud – mit Dapr
    13

    View full-size slide

  14. § Portable, event-driven runtime for building distributed applications
    across Cloud and edge
    § Making developers’ lifes easier
    § Best practices building blocks
    § Consistent, portable, open APIs
    § Extensible & pluggable components
    § Adopting 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
    14

    View full-size slide

  15. Cloud-Native Microservices für alle:
    On-Premises oder Cloud – mit Dapr
    Cloud-Native building blocks
    15

    View full-size slide

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

    View full-size slide

  17. • “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
    17
    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

    View full-size slide

  18. Cloud-Native Microservices für alle:
    On-Premises oder Cloud – mit Dapr
    Dapr components
    18
    My App
    Observability
    Prometheus AppInsights Jaeger
    Zipkin
    Bindings
    & Triggers
    State
    Stores
    Secret
    Stores
    PubSub
    Brokers
    https://github.com/dapr/components-contrib

    View full-size slide

  19. § Start right away with CLI
    § Can be integrated
    into any IDE
    § Focus on Dapr
    infrastructure aspects
    § VS Code tooling available
    § First class support for
    Docker containers
    § Configuration via YAML files
    § Config
    § Components
    § etc.
    Cloud-Native Microservices für alle:
    On-Premises oder Cloud – mit Dapr
    Getting started with Dapr
    19

    View full-size slide

  20. Dapr
    Select scenarios
    Cloud-Native Microservices für alle:
    On-Premises oder Cloud – mit Dapr
    20

    View full-size slide

  21. Cloud-Native Microservices für alle:
    On-Premises oder Cloud – mit Dapr
    Cloud-Native building blocks
    21

    View full-size slide

  22. § 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
    22

    View full-size slide

  23. § 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
    23
    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"}

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  26. § At-least-once semantics for message delivery
    Cloud-Native Microservices für alle:
    On-Premises oder Cloud – mit Dapr
    Publish & subscribe
    26
    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"}

    View full-size slide

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

    View full-size slide

  28. Hosting
    Cloud-Native Microservices für alle:
    On-Premises oder Cloud – mit Dapr
    28

    View full-size slide

  29. § 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
    § Azure Container Apps
    § Dapr
    built-in
    § Fixed
    version
    Cloud-Native Microservices für alle:
    On-Premises oder Cloud – mit Dapr
    Hosting anywhere
    29

    View full-size slide

  30. Cloud-Native Microservices für alle:
    On-Premises oder Cloud – mit Dapr
    Kubernetes – on-prem or Cloud
    30
    Any cloud or edge infrastructure
    Pod
    Actor
    partition
    placement
    Placement
    Pod
    Dapr
    runtime
    injector
    Injector
    Pod
    Cert
    authority
    and identity Sentry
    Pod
    Update
    component
    changes Operator
    Pod
    My App
    Kubelet Use components
    Inject Dapr sidecar
    into annotated
    pods
    Inject env variables
    Manage mTLS
    between services
    Assign spiffe
    identity
    Create mapping table of
    actor instances to pods
    Manage component
    updates
    Manage Kubernetes
    service endpoints
    Readiness and Liveness
    probe on healthz API to
    determine Dapr health
    state
    State Stores
    Pub/Sub
    Brokers
    Secret Stores
    Bindings
    & Triggers
    Observability
    Dapr Components
    Operator
    Deploys and
    manages Dapr

    View full-size slide

  31. Recap
    Cloud-Native Microservices für alle:
    On-Premises oder Cloud – mit Dapr
    31

    View full-size slide

  32. Recap
    Cloud-Native Microservices für alle:
    On-Premises oder Cloud – mit Dapr
    32
    YOU need to decide:
    Dapr abstraction
    or not
    Modern applications need
    to be Cloud-native
    Microservices are just
    one architecture style
    (and more than that…)
    Dapr 😀
    § Encapsulates proven
    patterns in building
    blocks
    § Pluggable components
    § Language-agnostic
    § Host-agnostic
    No technology,
    framework, runtime can
    solve business domain
    problems
    Dapr 🤔
    § Some features still
    evolving
    § Docs and samples
    need to be improved
    § Might be overhead

    View full-size slide

  33. https://www.thinktecture.com/ueber-uns/karriere/
    Dankeschön!
    Christian Weyer
    https://thinktecture.com/christian-weyer
    Demos aus der Session:
    https://github.com/thinktecture/
    dapr-basics-demos
    https://github.com/thinktecture-labs/
    cloud-native-sample
    33

    View full-size slide