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

Quo Vadis Netflix Stack?

Quo Vadis Netflix Stack?

Netflix dürfte für die meisten als Streaming-Dienstleister bekannt sein. Viele Entwickler erfreuen sich an den Open-Source Werkzeugen wie Eureka für Service-Discovery und Hystrix für Resilience. Dementsprechend gilt Netflix auch als Pionier rund um die Themen Microservices und Betrieb. Mit Hilfe von Spring Cloud Netflix ist es möglich durch wenige, einfache Annotationen die entsprechenden Komponenten von Netflix zu integrieren, konfigurieren und zu nutzen. Allerdings hat Netflix bereits die Weiterentwicklung an Eureka 2.0 und an Hystrix eingestellt. Im Zuge dieser Entscheidung wird Spring Cloud Netflix ebenfalls nicht mehr weiterentwickelt. In diesem Vortrag soll aufgezeigt werden, welche Alternativen Netflix selbst vorschlägt, um resiliente Cloud-Architekturen zu entwickeln. Es wird auf die Konzepte sowie Integration eingegangen und wie diese zu einer sinnvollen Architektur kombiniert werden können. Darüber hinaus soll dargestellt werden, welche Out-Of-The-Box Lösungen PaaS wie Cloud Foundry, verteilte Container-Umgebungen wie Kubernetes und Services Meshes bereitstellen, wie diese zu bewerten sind und wie sie genutzt werden können.

Fabian Keller

July 04, 2019
Tweet

More Decks by Fabian Keller

Other Decks in Programming

Transcript

  1. Baris Cubukcuoglu Software Engineer Photographer @bariscubuk__ 2019-07-04 / Java Forum

    Stuttgart / Baris Cubukcuoglu & Fabian Keller 2 Fabian Keller Software Engineer Woodworker @_fabiankeller
  2. Netflix OSS – Well known Projects 2019-07-04 / Java Forum

    Stuttgart / Baris Cubukcuoglu & Fabian Keller 4 Zuul API Gateway Eureka Service Registry Archaius Centralized Config Microservice A Hystrix Ribbon Microservice B Hystrix Ribbon Feign Feign
  3. Eureka, Feign & Ribbon (with Spring Cloud) 2019-07-04 / Java

    Forum Stuttgart / Baris Cubukcuoglu & Fabian Keller 5 Service Discovery Load Balancing Circuit Breaker API Gateway Dynamic Config
  4. Hystrix (with Spring Cloud) 2019-07-04 / Java Forum Stuttgart /

    Baris Cubukcuoglu & Fabian Keller 6 Service Discovery Load Balancing Circuit Breaker API Gateway Dynamic Config
  5. Zuul (with Spring Cloud) 2019-07-04 / Java Forum Stuttgart /

    Baris Cubukcuoglu & Fabian Keller 7 Service Discovery Load Balancing Circuit Breaker API Gateway Dynamic Config
  6. Archaius (with Spring Cloud) 2019-07-04 / Java Forum Stuttgart /

    Baris Cubukcuoglu & Fabian Keller 8 Service Discovery Load Balancing Circuit Breaker API Gateway Dynamic Config
  7. Archaius Centralized Config Zuul API Gateway Eureka Service Registry Microservice

    A Hystrix Ribbon Microservice B Hystrix Ribbon Feign Feign Which Projects are affected? 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu & Fabian Keller 10 Maintenance Mode Maintenance Mode
  8. Are there any alternatives? TL;DR: yes! For Hystrix: Resilience4j, Sentinel,

    Spring Retry For Hystrix Dashboard / Turbine: Micrometer + Monitoring System (e.g. Prometheus etc.) For Archaius: Spring Cloud Config, HashiCorp Vault For Ribbon: Spring Cloud Load Balancer, gRPC 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu & Fabian Keller 11
  9. Fallacies of Distributed Computing see https://bit.ly/1IEpFC0 The network is reliable

    Latency is zero Bandwidth is infinite The network is secure Topology doesn’t change There is one administrator Transport cost is zero The network is homogeneous 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu & Fabian Keller 12
  10. Patterns • Stability • Capability • Transparency 2019-07-04 / Java

    Forum Stuttgart / Baris Cubukcuoglu & Fabian Keller 13
  11. Service Discovery 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu

    & Fabian Keller 15 Client Registry Service A Service A Service A Service A Service A Service B Load balance Register Lookup Service Discovery Load Balancing Circuit Breaker API Gateway Dynamic Config
  12. Load Balancing 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu

    & Fabian Keller 16 Client Service Service Availability Filtering Client Service Service Round Robin Client Service 0.7 Service 0.3 Weighted Response Time Service Discovery Load Balancing Circuit Breaker API Gateway Dynamic Config
  13. Circuit Breaker 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu

    & Fabian Keller 17 Execute Command Run Fallback Service Discovery Load Balancing Circuit Breaker API Gateway Dynamic Config
  14. Bulkhead 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu &

    Fabian Keller 18 Thread pool Service X Service Z Resource Call Resource Call Resource Call DB Y Service Discovery Load Balancing Circuit Breaker API Gateway Dynamic Config
  15. Bulkhead 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu &

    Fabian Keller 19 Service X Service Z Resource Call Resource Call Resource Call DB Y Pool X Pool Y Pool Z Service Discovery Load Balancing Circuit Breaker API Gateway Dynamic Config
  16. API Gateway 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu

    & Fabian Keller 20 Client Resource Resource Resource Resource Service Discovery Load Balancing Circuit Breaker API Gateway Dynamic Config
  17. API Gateway 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu

    & Fabian Keller 21 Client Resource Resource Resource Resource API Gateway Service Discovery Load Balancing Circuit Breaker API Gateway Dynamic Config
  18. 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu & Fabian

    Keller 22 The Modern Cloud Stack Photo by Pero Kalimero on Unsplash
  19. Where do we begin with? A homogeneous microservice landscape, yeah

    right… 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu & Fabian Keller 23 Netflix OSS Netflix OSS Netflix OSS Netflix OSS Netflix OSS Netflix OSS Netflix OSS Netflix OSS ?!
  20. So how do we solve all these challenges? Using sidecars

    instead of libraries 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu & Fabian Keller 24 Application Layer Cross-cutting concerns Infrastructure Layer Cross-cutting concerns Application Netflix OSS Application Egress Ingress
  21. Egress Ingress Egress Ingress Egress Ingress Egress Ingress Egress Ingress

    Egress Ingress Egress Ingress Egress Ingress Adding the sidecars to all containers We can have the exact same architecture as before 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu & Fabian Keller 25
  22. 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu & Fabian

    Keller 26 Photo by Erdenebayar Bayansan on Pixabay
  23. Cloud Foundry What is Cloud Foundry? 2019-07-04 / Java Forum

    Stuttgart / Baris Cubukcuoglu & Fabian Keller 27 Open Source Faster to iterate Scalable platform cf push -p target/spring-music.jar
  24. Container Network Cloud Foundry Service Discovery a.k.a. Container Networking. Also

    enables client-side load balancing via DNS 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu & Fabian Keller 28 moments.apps.internal 10.254.40.156 media.apps.internal 10.254.40.148 media.apps.internal 10.254.40.123 media.apps.internal 10.254.40.42 myapp.com 10.254.40.156 moments.apps.internal 10.254.40.148 Service Discovery Load Balancing Circuit Breaker API Gateway Dynamic Config DNS? moments.apps.internal A 10.254.40.148 A 10.254.40.156
  25. Cloud Foundry Service Discovery How to setup CF container network

    2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu & Fabian Keller 29 Service Discovery Load Balancing Circuit Breaker API Gateway Dynamic Config
  26. Cloud Foundry Route Services Taking care of ingress traffic 2019-07-04

    / Java Forum Stuttgart / Baris Cubukcuoglu & Fabian Keller 30 Cloud Foundry CF Router App Load Balancr Client Route Service Service Broker • Security • Rate Limiting • Caching • Tracing Service Discovery Load Balancing Circuit Breaker API Gateway Dynamic Config
  27. Cloud Foundry Dynamic App Config 2019-07-04 / Java Forum Stuttgart

    / Baris Cubukcuoglu & Fabian Keller 31 CF SET-ENV CF RESTART Service Discovery Load Balancing Circuit Breaker API Gateway Dynamic Config
  28. 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu & Fabian

    Keller 32 Kubernetes Istio Photo by Bobby Burch on Unsplash
  29. Kubernetes Service Discovery Deployments and Services 2019-07-04 / Java Forum

    Stuttgart / Baris Cubukcuoglu & Fabian Keller 33 Service Discovery Load Balancing Circuit Breaker API Gateway Dynamic Config Environment moments 172.10.40.156 media 172.10. 40.148 media 172.10.40.123 media 172.10.40.42 Cluster IP 10.254.40.156 moments 172.10.40.148 DNS? moments A 10.254.40.148
  30. Kind: k8s/Deployment Kind: k8s/Service moments.my-namespace.svc.cluster.local 10.98.61.186 Kubernetes Service Discovery Exposing

    a service 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu & Fabian Keller 34 Service Discovery Load Balancing Circuit Breaker API Gateway Dynamic Config new RestTemplate().exchange(„http://moments/api/v1/timeline“, …) Pod 1 moments-pod 172.10.40.148 Pod 2 moments-pod 172.10.40.156
  31. Istio Architecture Control Plane and Data Plane 2019-07-04 / Java

    Forum Stuttgart / Baris Cubukcuoglu & Fabian Keller 35 Control Plane Data Plane Pilot Citadel Mixer Pod 1 Envoy App 1 Pod 2 Envoy App 2
  32. Istio VirtualService Adding a VirtualService layer to intelligently route traffic

    2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu & Fabian Keller 36 Service Discovery Load Balancing Circuit Breaker API Gateway Dynamic Config Kind: k8s/Deployment Kind: k8s/Service moments-v1 10.98.61.186 Pod 1 moments-v1-pod Pod 2 moments-v1-pod Kind: istio/VirtualService moments Match routing rules: /api/v1 à moments-v1 /api/v2 à moments-v2 Kind: k8s/Deployment Pod 1 moments-v2-pod Kind: k8s/Service moments-v2 10.98.61.193
  33. Istio Destination Rules Destination rules apply after routing rules are

    evaluated Apply various policies to traffic: • Load Balancer Policy (RR, Random) • Client TLS • Circuit Breaker 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu & Fabian Keller 37 Service Discovery Load Balancing Circuit Breaker API Gateway Dynamic Config
  34. K8s/Istio Dynamic App Config 2019-07-04 / Java Forum Stuttgart /

    Baris Cubukcuoglu & Fabian Keller 38 VIM KUBE-APP.YAML KUBECTL APPLY Service Discovery Load Balancing Circuit Breaker API Gateway Dynamic Config
  35. Istio Additional Features This was just the beginning… • Automatic

    Retries • Rate Limiting • mTLS • Policy Enforcement • Observability & Monitoring • Distributed Tracing • Fault Injection 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu & Fabian Keller 39
  36. Platform Support Service Discovery Eureka Container Networking Kubernetes Services Load

    Balancing Ribbon Container Networking Kubernetes Services Circuit Breaker Hystrix / Turbine – Istio Destination Rule API Gateway Zuul Route Services Canary Deployments Istio Virtual Service Istio Gateway Dynamic Config Archaius cf set-env cf restart vim kube-app.yaml kubectl apply 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu & Fabian Keller 40
  37. Limitations There is always a flipside • We‘re now hiring

    for a full-time YAML engineer • Sometimes infrastructure shouldn‘t take care (e.g. retries) • Yet another markup language stack to learn • People will start to write microservices in other languages 2019-07-04 / Java Forum Stuttgart / Baris Cubukcuoglu & Fabian Keller 41
  38. Thanks! kubectl apply –f questions.yaml Come visit our booth! 2019-07-04

    / Java Forum Stuttgart / Baris Cubukcuoglu & Fabian Keller Photo by Ajeet Mestry on Unsplash