moving to microservices: visualising technical debt, kubernetes, … · 2020-02-27 · monolith...

62
Moving to Microservices: Visualising Technical Debt, Kubernetes, and GraphQL with Michelle Krejci

Upload: others

Post on 20-May-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

Moving to Microservices:

Visualising Technical Debt,

Kubernetes, and GraphQL with Michelle Krejci

Page 2: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Moving to Microservices:

Visualising Technical

Debt, Kubernetes, and

GraphQL

Page 3: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

I have been on a journey of discovery

through a difficult challenge of upgrading a

successful but inflexible monolithic system and I want to tell you how I have approached

this problem in part by leveraging the

capabilities of Kubernetes and GraphQL and

other fun toys which sound good in a

presentation proposal.

Page 4: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Here is a compressed 30 minute tutorial

and some

incantations you can use when you get back to

your office

of

how to use these things

that will solve all of your

problems and guarantee that you feel good

about coming to this talk.

Page 5: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

I’ll wait.

Page 6: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

6

Michelle

Software Engineer @getpantheon

Page 7: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Page 8: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Let’s start with the ending.

Page 9: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Build how

you build on

pace with what

you build.

Page 10: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Build how

you build on

pace with what

you build.

Page 11: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Act 1

Build it quick.

Page 12: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

Actual footage of an early stage startup.

Page 13: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

Everyone has the same resources.

Every team member is working on building a viable product that won’t tip over.

The build process is: have an idea, try it, see if it can stand up + people like it.

Page 14: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Pantheon at this stage

Frontend

(node.js)

Monolith

(twistd python)

Two languages

Two repositories

Two prod environments

Page 15: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

How we build

Dev on

clone of

prod

Push to

Master

runs CI

Jenkins

kicks off

Chef

run

Page 16: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

We did it!

Now, no one touch it.

Page 17: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Act 2

When you

need to touch

it.

Page 18: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

At this stage, should the existing

production system

be the spec?

Page 19: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Write a bunch of

tests to check that if it’s not this -------------

-------->

it’s broken.

Page 20: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Page 21: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

feature or bug?

Page 22: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

22

Page 23: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Break up what

you build

Page 24: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Moving to Microservices:

Visualising Technical

Debt, Kubernetes, and

GraphQL

Page 25: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Pantheon at this stage

Frontend

(node.js)

Monolith

(twistd python)

Service A

(python)

Service B

(python)

Service C

(go)

Service C

(go)

Many languages

Many repos

Many prod environments

WINS

Domains that can be event

driven are a good starting

place.

Page 26: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

But this will force

you to change how you build

Page 27: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Page 28: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Moving to Microservices:

Visualising Technical

Debt, Kubernetes, and

GraphQL

Page 29: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

How we build

Dev on

clone of

prod -

copied

into k8

ns

Push to

branch

runs CI

CI

builds

image +

pushes

CI

applies

k8s

config

Service

defines

build with

common

make

WINS

Common repo of Makefiles

Leverage namespaces in

k8s

Internal tool for building dev

Page 30: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Cool but...

feature or bug?

Page 31: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Act 3

The Spec.

Page 32: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Page 33: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Page 34: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Ideal specs

unrealistic testing suites

artifacts of an optimistic past

are used to build

that add so much friction they became

Page 35: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Page 36: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

#I don’t know how it

#works but don’t

#touch it. Trust me.

Page 37: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Moving to Microservices:

Visualising Technical

Debt, Kubernetes, and

GraphQL

Page 38: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

#I don’t know how it

#works but don’t

#touch it. Trust me.

Page 39: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

{

Antenna(id: "123") {

marshmallow {

fluffiness

}

spaghetti {

}

}

}

{

MiddleBit(id: "123") {

spaghetti(id: “456”) {

bendiness

}

}

}

{

Base(id: "123") {

tape {

length

}

}

}

Client Backend

s

Page 40: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Pantheon at this stage

Frontend

(node.js)

Monolith

(twistd python)

Service A

(python)

Service B

(python)

Service C

(go)

Service C

(go)

REST→ GraphQL

Schema-first

API Gateway to strangle monolith

API Gateway

(Apollo Server)

Schema

{

[...]

}

Page 41: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

How we build

Dev on

clone of

prod -

copied

into k8

ns

Push to

branch

runs CI

CI

builds

image +

pushes

CI

applies

k8s

config

Service

defines

build with

common

make

Define

schema Check

against

schema

Update

to

schema

merged

Page 42: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Page 43: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Act 4

The Exit.

Page 44: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Switch to language the rest of the business

understands.

Page 45: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

So you want to exit...

Page 46: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

soon-

ish.

Page 47: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

But you have a

gap.

Page 48: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Maybe you can fill

that gap by adding

new features!

Cool

thing

1

Cool

thing

1

Cool

thing

2

Cool

thing

3

Cool

thing

2

Cool

thing

1

Page 49: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Moving to Microservices:

Visualising Technical

Debt, Kubernetes, and

GraphQL

Page 50: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

“if you develop a program for a long period of time by only adding

features and never reorganizing it

to reflect your understanding of

those features, then eventually that

program simply does not contain any understanding and all efforts to work

on it take longer and longer”

- Ward Cunningham

Page 51: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Maybe you can fill

that gap by adding

new features…?

Cool

thing

1

Cool

thing

1

Cool

thing

2

Cool

thing

3

Cool

thing

2

Cool

thing

1

Page 52: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Cool thing 1

If you have not built

your build on pace...

probably not.

Page 53: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

You need to invest in

teams to ship the

things.

Cool

team

1

Cool

team

2

Cool

team

3

Page 54: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

AND you’re going to

build infrastructure to

support the product

being shipped.

Cool

Thing

1

Cool

Thing

2

Cool

Thing

3

Page 55: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

AND you’re going to build

the tools to support the

infrastructure that

supports the product

being shipped.

Cool

Thing

1

Cool

Thing

2

Cool

Thing

3

Cool

Tool

1

Cool

Tool

2

Page 56: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

AND you’re going to need

teams to support the tools

that support the

infrastructure that supports

the product being

shipped....

Cool

Thing

1

Cool

Thing

2

Cool

Thing

3

Cool

Tool

1

Cool

Tool

2

Page 57: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Page 58: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Sales knows to grow their team and

their process as complexity

increases.

Page 59: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Build how

you build on

pace with what

you build.

Page 60: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

Incidentally,

Page 61: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

I am terrible at this.

Page 62: Moving to Microservices: Visualising Technical Debt, Kubernetes, … · 2020-02-27 · Monolith (twistd python) Service A (python) Service B (python) Service C (go) Service C (go)

PA

NT

HE

ON

.IO

62

@mcraychee