Top Banner
67

Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

May 22, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems
Page 2: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

■ Microservice architectures

■ Distributed systems

■ Cloud-native applications

■ Service-oriented architectures

■ Multi-service systems

@ellenkorbes

Page 3: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems
Page 4: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

ellen körbesellen körbes developer [email protected]@ellenkorbesthey/them

Page 5: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

Remember monoliths?Remember monoliths?

@ellenkorbes

Page 6: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

■ Service dependencies aren't aproblem. 

■ Your dependency graph is managedby your compiler.

■ Writing application-wide tests is easy.

Monoliths:

@ellenkorbes

Page 7: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

■ It’s easy to learn the system for thefirst time.

■ The required mental context ismanageable.

■ Good feedback loops.

Monoliths:

@ellenkorbes

Page 8: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

They were fun.They were fun. 

(Some of them, anyway.)

@ellenkorbes

Page 9: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

The magic of programming was there.The magic of programming was there.

@ellenkorbes

Page 10: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

Then came multi-service systems.Then came multi-service systems.

@ellenkorbes

Page 11: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

AAn amazing new world.n amazing new world.  

But!But!

@ellenkorbes

Page 12: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

Let's see it.Let's see it.

@ellenkorbes

Page 13: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems
Page 14: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems
Page 15: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

How do you develop on aHow do you develop on asystem like this in practice?system like this in practice?

@ellenkorbes

Page 16: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

Painfully.Painfully.

@ellenkorbes

Page 17: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

■ Service dependencies are a pain tomanage.

Why?

@ellenkorbes

Page 18: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems
Page 19: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

■ Service dependencies are a pain tomanage.

■ Human brains aren’t made to bedependency graphs.

Why?

@ellenkorbes

Page 20: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

@ellenkorbes

Page 21: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

■ Service dependencies are a pain tomanage.

■ Human brains aren’t made to bedependency graphs.

■ Testing is not trivial.

Why?

@ellenkorbes

Page 22: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

@ellenkorbes

Page 23: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

prototype_property_undefined_state_setter_factory_factoryPrototypePropertyUndefinedStateSetterFactoryFactory

Page 24: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

prototype_property_undefined_state_setter_factory_factoryPrototypePropertyUndefinedStateSetterFactoryFactory

Page 25: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

■ On-boarding is difficult.                              

Why?

@ellenkorbes

Page 26: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems
Page 27: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

➜ ~ cd ~/go/src/github.com/microservices-demo/catalogue ➜ catalogue git:(master) ✗ go test # github.com/microservices-demo/catalogue ./service_test.go:132: T.Errorf call needs 2 args but has 3 args FAIL github.com/microservices-demo/catalogue [build failed] ➜ catalogue git:(master) ✗ go build -o catalogue ➜ catalogue git:(master) ✗ chmod +x catalogue ➜ catalogue git:(master) ✗ ./catalogue ./catalogue: 2: ./catalogue: Syntax error: newline unexpected ➜ catalogue git:(master) ✗ ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ---> f7ae3bc3a33b Successfully built f7ae3bc3a33b Successfully tagged front-end:latest env: can't execute 'bash': No such file or directory Makefile:55: recipe for target 'e2e' failed make: *** [e2e] Error 127 ➜ front-end git:(master) ✗ npm start > [email protected] start /home/ellen/code/microservices-demo/front-end > node server.js Using local session manager App now running in development mode on port 8079 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ➜ shipping git:(master) mvn -DskipTests package [15/446] [INFO] Scanning for projects... Downloading: https://repo.spring.io/libs-release/org/springframework/boot/spring-boot-starter-parent/1.4.0.RELEASE/spring-boot-st arter-parent-1.4.0.RELEASE.pom Downloading: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/1.4.0.RELEASE/spring-boot-s tarter-parent-1.4.0.RELEASE.pom [ERROR] [ERROR] Some problems were encountered while processing the POMs: [FATAL] Non-resolvable parent POM for works.weave.microservices-demo:shipping:[unknown-version]: Could not transfer artifact org. springframework.boot:spring-boot-starter-parent:pom:1.4.0.RELEASE from/to spring-releases (https://repo.spring.io/libs-release): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must b e non-empty and 'parent.relativePath' points at wrong local POM @ line 14, column 13 @ [ERROR] The build could not read 1 project -> [Help 1] [0] 0:zsh* "ellen@t480: ~/go/src/" 15:05 25-Okt-18

Page 28: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

■ Onboarding is difficult.

■ The amount of mental overhead isexhausting.

Why?

@ellenkorbes

Page 29: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

@ellenkorbes

Page 30: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

■ Onboarding is difficult.

■ The amount of mental overhead isexhausting.

■ And the feedback loops?

Why?

@ellenkorbes

Page 31: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

xkcd.com

Page 32: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

i.e. not fun.i.e. not fun.

@ellenkorbes

Page 33: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

The amount of hassleThe amount of hassletakes all the magic away.takes all the magic away.

@ellenkorbes

Page 34: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

Fun

Hassle

Worth it!

Why did I get intotech to begin with?

Multi-container systems development

x

@ellenkorbes

Page 35: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

Let's solve this problem.Let's solve this problem.

@ellenkorbes

Page 36: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems
Page 37: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

Garden is a development engine forGarden is a development engine forKubernetes that makes developing,Kubernetes that makes developing,building and testing multi-servicebuilding and testing multi-servicesystems fast, easy, and fun.systems fast, easy, and fun.

@ellenkorbes

Page 38: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

"A what, now?""A what, now?"

@ellenkorbes

Page 39: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

That whole pile of hassleThat whole pile of hasslewe just talked about?we just talked about?

@ellenkorbes

Page 40: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

Gone.Gone.

@ellenkorbes

Page 45: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

How does it work?How does it work?

@ellenkorbes

Page 46: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

➜ sock-shop tree . . ├── garden.yml └── services ├── carts │ └── garden.yml ├── carts-db │ └── garden.yml ├── catalogue │ └── garden.yml ├── catalogue-db │ └── garden.yml ... └── user-db └── garden.yml

@ellenkorbes

Page 47: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

project: name: sock-shop environments: - name: local providers: - name: local-kubernetes

@ellenkorbes

Page 48: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

module: description: Catalogue service type: container name: catalogue dockerfile: /docker/catalogue/Dockerfile services: - name: catalogue ports: - name: http containerPort: 80 dependencies: - catalogue-db

@ellenkorbes

Page 49: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

module: description: Front end service type: container name: front-end services: - name: front-end command: [/usr/local/bin/npm, start] ports: - name: http containerPort: 8080 ingresses: - path: / port: http dependencies: - orders - payment - user - catalogue - carts tests: - name: unit command: [npm, test] - name: e2e command: [npm, test-e2e] dependencies: - orders - payment - user

Page 50: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

@ellenkorbes

Page 51: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

Front-end:REMOTE REPO

LOCAL REPO

Page 52: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

Front-end:module: description: Orders service type: container name: orders repositoryUrl: https://github.com/microservices-demo/orders.git#0.4.7 dockerfile: /docker/orders/Dockerfile services: - name: orders ...

module: description: Carts service type: container name: carts repositoryUrl: https://github.com/microservices-demo/carts.git#0.4.8 dockerfile: /docker/carts/Dockerfile services: - name: carts ...

module: description: Front end service type: container name: front-end services: - name: front-end command: [/usr/local/bin/npm, start] ports: - name: http ...

@ellenkorbes

Page 53: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

■ Dependency management is built inand virtually free for all build, test, anddeploy tasks.

■ The workflow is consistent, reliable,and low maintenance.

■ Dramatically shorter feedback loops.

Garden:

@ellenkorbes

Page 54: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

Our vision.Our vision.

@ellenkorbes

Page 55: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

A layer betweenA layer betweenorchestration andorchestration anddevelopment.development.

@ellenkorbes

Page 56: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

■ Your infrastructure/orchestration.

■ How your stack looks when done.

Currently, you declare:

@ellenkorbes

Page 57: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

■ Your development workflow.

■ How your stack gets to done.

Now, you can declare:

@ellenkorbes

Page 58: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

The context humansThe context humansused to have to carryused to have to carrybecomes codified.becomes codified.

@ellenkorbes

Page 59: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

A system that knowsA system that knowshow your stack works.how your stack works.

@ellenkorbes

Page 60: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

Remote developmentRemote developmentenvironment.environment.

@ellenkorbes

Page 61: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

■ Machine learning code analysis

■ Security test plugins

■ Performance analysis

How about, as youcode:

@ellenkorbes

Page 62: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

The development environmentThe development environmentof the future is of the future is not an IDEnot an IDE..

@ellenkorbes

Page 63: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

The development environmentThe development environmentof the future is of the future is a system thata system thatknows how your stack worksknows how your stack works..

@ellenkorbes

Page 64: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

Open source. Alpha stage.Open source. Alpha stage.Eager to hear from you.Eager to hear from you.

@ellenkorbes

Page 65: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

Focus on theFocus on thefun part and letfun part and letGarden do the rest.Garden do the rest.

Page 66: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems

[email protected] | @ellenkorbes

Page 67: Microservice architectures Distributed systems Cloud-native ...ellenkorbes.com/assets/bringing-magic-to-microservice-architecture... · Microservice architectures Distributed systems