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

Tear down this pyramid... using functions and m...

Tear down this pyramid... using functions and meshes

In this live coding talk you will learn about techniques you can use to better test your microservice architecture. We will build a stateful HTTP-based Pac-Man game engine from highly isolated and testable components using pure functions, type parameters, side cars and service meshes.

Michał Płachta

October 09, 2018
Tweet

More Decks by Michał Płachta

Other Decks in Programming

Transcript

  1. @miciek @miciek Michał Płachta michalplachta.com @miciek E2E Integration Unit Tear

    down this pyramid... using functions & meshes Tear down this pyramid... using functions & meshes
  2. @miciek In this talk... functions functional programming immutability Scala service

    meshes accidental complexity DevOps Kubernetes / Linkerd
  3. @miciek Pac-Man Game Server Frontend Backend 100ms - Grid setup

    - Direction change - Movement - Multiple games - Fetch & render - Send direction changes
  4. @miciek Pac-Man Game Server Frontend Backend 100ms Collectibles 100ms -

    Things that can be eaten - Dots - Fruit (appearing randomly)
  5. @miciek Creating Collectibles service code - fast HTTP tests -

    No HTTP server - No mocking production - pacman-collectibles:v1 - Yaml → K8s
  6. @miciek Rolling out Collectibles Frontend Backend Collectibles v1 prod /

    no collectibles v1 prod / no collectibles v1 not used player
  7. @miciek Big Bang Frontend Backend Collectibles v1 prod / no

    collectibles v2 prod / collectibles v1 prod / no collectibles v2 prod / collectibles v1 not used prod player
  8. @miciek What if? Frontend Backend Collectibles v1 prod / no

    collectibles v1 prod / no collectibles v1 player Frontend v2 collectibles Backend v2 collectibles
  9. @miciek Per-request routing... Frontend Backend Collectibles v1 prod / no

    collectibles v1 prod / no collectibles v1 Frontend v2 collectibles Backend v2 collectibles player test player (automated)
  10. @miciek Per-request routing... Frontend Collectibles v1 prod / no collectibles

    v1 Frontend v2 collectibles Player test player Linkerd
  11. @miciek Rolling out Collectibles Frontend Collectibles v1 prod / no

    collectibles v1 Frontend v2 collectibles Player normal requests test player requests with routing headers Linkerd
  12. @miciek Cherry Picking using Header Linkerd Service A Service B

    Service Y Service Z Backend v2 Frontend v2 Frontend v1 Collectibles l5d-dtab: /k8s/pacman/http/backend=>/k8s/pacman/http/backend-test
  13. @miciek Communicating Services Linkerd Service A Service B Service Y

    Service Z Backend v2 Frontend v2 Frontend v1 Collectibles
  14. @miciek Communicating Services Service Discovery Circuit Breaking Security Telemetry Linkerd

    Service A Service B Service Y Service Z Backend v2 Frontend v2 Frontend v1 Collectibles For free:
  15. @miciek New Testing Pyramid Real Fast Stable Quick to read/write

    99% production code No HTTP Servers Function parameters Abstracting over data Routing test traffic Isolated tests on PROD No Mocking
  16. @miciek New Testing Pyramid Real Fast Stable Quick to read/write

    99% production code No HTTP Servers Function parameters Abstracting over data Routing test traffic Isolated tests on PROD functions service meshes No Mocking
  17. @miciek Next steps ➔ Play around with https://github.com/miciek/pacman-kubernetes-linkerd project ➔

    Play with Kubernetes and Linkerd using Katakoda: https://www.katacoda.com/stephpr/scenarios/k8s-l5d ➔ Play with Kubernetes and Istio using Katakoda https://www.katacoda.com/courses/istio/deploy-istio-on-kubernetes
  18. @miciek @miciek Michał Płachta michalplachta.com @miciek Real Tear down this

    pyramid... using functions & meshes Tear down this pyramid... using functions & meshes Fast Stable Quick to read/write 99% production code