21
The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

The World after Microservice Migration with Service Mesh and Contract Testing

Dejan Mitrovic

Lead Software Engineer @ Free2Move

Page 2: Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

• Motivation

• Service mesh

• CDC testing

Agenda

Page 3: Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

Vehicle providers in a monolith

sbt clean test it:test ...

java.lang.ClassNotFoundException

Page 4: Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

Providers as microservices

GET /vehicles?providers=a,b,c&...POST /providers/drive2move/bookings

Page 5: Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

• Motivation

• Service mesh

• CDC testing

Agenda

Page 6: Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

Service mesh

“A dedicated infrastructure layer for making service-to-service communication

safe, fast, and reliable.”

https://buoyant.io/2017/04/25/whats-a-service-mesh-and-why-do-i-need-one

Dynamic routing

Load-balancing

Retryable failures

Circuit-breaking

Distributed tracing & metrics

Page 7: Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

linkerd deployment models

l5d-ctx-trace

Page 8: Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

linkerd routing 1/3 - identification

identifier:kind: io.l5d.header.tokenheader: Host

---/svc/free2move

identifier:kind: io.l5d.pathsegments: 2consume: false

---/svc/providers/drive2move

identifier:kind: io.l5d.methodAndPath

---/svc/1.1/POST/free2move

Page 9: Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

linkerd routing 2/3 - binding

dtab: | /svc => /$/inet/legacy.net/8000 /svc => /#/io.l5d.consul/demo /svc/providers => /svc /svc/vehicles => /svc/aggregator /svc/providers/drive2move

/svc/providers => /svc/svc/drive2move /svc => /#/io.l5d.consul/demo/#/io.l5d.consul/demo/drive2move

identifier: - kind: io.l5d.path segments: 2

Page 10: Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

linkerd routing 3/3 - resolution

namers: kind: io.l5d.consul host: consul port: 8500

/#/io.l5d.consul/demo/drive2move [1.1.1.1:32761, 1.1.1.2:31258]

dtab: | /svc => /$/inet/legacy.net/8000 /svc => /#/io.l5d.consul/demo

Page 11: Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

linkerd performance tuning

https://discourse.linkerd.io/t/linkerd-performance-tuning/447

Page 12: Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

Demo time

Page 13: Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

linkerd 2.x

https://linkerd.io/2/architecture/

Page 14: Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

linkerd alternatives

https://istio.io/ https://konghq.com/solutions/service-mesh/https://www.consul.io/intro/getting-started/connect.html

Page 15: Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

Final architecture on AWS

Page 16: Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

• Motivation

• Service mesh

• CDC testing

Agenda

Page 17: Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

Consumer-driven contract testing

Page 18: Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

Pact framework

Ruby

JVM (Java, Scala, Clojure, etc.)

.NET (C#)

Go

Swift, Objective-C

JavaScript

Python

PHP

https://docs.pact.io/

Page 19: Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

Demo time

Page 20: Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

Contract recording

Page 21: Service Mesh and Contract Testing The World after ... · The World after Microservice Migration with Service Mesh and Contract Testing Dejan Mitrovic Lead Software Engineer @ Free2Move

Q & (hopefully) A