Tear down this pyramid... using functions and meshes

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.

6f6dc1b13fd3fe35d36db3adafcb0c8e?s=128

Michał Płachta

October 09, 2018
Tweet

Transcript

  1. 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. 4.

    @miciek In this talk... functions functional programming immutability Scala service

    meshes accidental complexity DevOps Kubernetes / Linkerd
  3. 6.

    @miciek Pac-Man Game Server Frontend Backend 100ms - Grid setup

    - Direction change - Movement - Multiple games - Fetch & render - Send direction changes
  4. 7.

    @miciek Pac-Man Game Server Frontend Backend 100ms Collectibles 100ms -

    Things that can be eaten - Dots - Fruit (appearing randomly)
  5. 9.

    @miciek Creating Collectibles service code - fast HTTP tests -

    No HTTP server - No mocking production - pacman-collectibles:v1 - Yaml → K8s
  6. 12.

    @miciek Rolling out Collectibles Frontend Backend Collectibles v1 prod /

    no collectibles v1 prod / no collectibles v1 not used player
  7. 13.

    @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. 14.

    @miciek What if? Frontend Backend Collectibles v1 prod / no

    collectibles v1 prod / no collectibles v1 player Frontend v2 collectibles Backend v2 collectibles
  9. 15.

    @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. 19.

    @miciek Per-request routing... Frontend Collectibles v1 prod / no collectibles

    v1 Frontend v2 collectibles Player test player Linkerd
  11. 21.

    @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. 23.

    @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. 24.

    @miciek Communicating Services Linkerd Service A Service B Service Y

    Service Z Backend v2 Frontend v2 Frontend v1 Collectibles
  14. 25.

    @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. 30.

    @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. 31.

    @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. 32.

    @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. 34.

    @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