Top Banner
DEPLOYING AND SCALING MICROSERVICES Sam Newman Goto Chicago 2016
190

Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

May 30, 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: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

DEPLOYING AND SCALING MICROSERVICESSam Newman Goto Chicago 2016

Page 2: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Page 3: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Sam Newman

Building MicroservicesDESIGNING FINE-GRAINED SYSTEMS

Page 4: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Core Principles

Page 5: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Artifacts

Core Principles

Page 6: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Artifacts

Core Principles

Platforms

Page 7: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Artifacts

Core Principles

Platforms

Page 8: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Accounts

Returns

Invoicing

Shipping

Inventory

Customer Service

Page 9: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Independent Deployability

Page 10: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Accounts

Returns v345

Invoicing

Inventory

Customer Service

Shipping v123

Page 11: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

AccountsInvoicing

Shipping v456

Inventory

Customer Service

Returns v890

Page 12: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

https://www.flickr.com/photos/torkildr/3462607995/

Page 13: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

TestsBuild Performance ProdUAT

https://www.flickr.com/

Page 14: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

TestsBuild Performance ProdUAT

https://www.flickr.com/

Source Control

Page 15: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

TestsBuild Performance ProdUAT

https://www.flickr.com/

Source Control

Page 16: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

TestsBuild Performance ProdUAT

https://www.flickr.com/

Source Control

Page 17: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

TestsBuild Performance ProdUAT

https://www.flickr.com/

Source Control

!

Page 18: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

TestsBuild Performance ProdUAT

https://www.flickr.com/

Source Control

! !

Page 19: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

TestsBuild Performance ProdUAT

https://www.flickr.com/

Source Control

! ! !

Page 20: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

TestsBuild Performance ProdUAT

https://www.flickr.com/

Source Control

! ! !

Page 21: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

TestsBuild Performance ProdUAT

https://www.flickr.com/

Source Control

! ! !

One Artifact For All Environments

Page 22: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

TestsBuild Performance ProdUAT

https://www.flickr.com/

Source Control

! ! !

One Artifact For All Environments

Same Deployment Process Everywhere

Page 23: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

$ deploy Returns v456 Production

Page 24: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

$ deploy Returns v456 Production

Service Name

Page 25: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

$ deploy Returns v456 Production

Service Name Version

Page 26: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

$ deploy Returns v456 Production

local

Service Name Version

Page 27: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

$ deploy Returns v456 Production

locallatest

Service Name Version

Page 28: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

$ deploy Returns v456 Production

locallatest

Service Name Version

Environment

Page 29: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

TestsBuild Large TestsUAT Prod

DB

Machine

UAT Environment

Machine

Perf

Page 30: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

TestsBuild UAT Perf Prod

Master DB

Machine

Production Environment

Machine Machine Machine

Slave DB

Page 31: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Same Artifact

Page 32: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Same Artifact

Different Topology

Page 33: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Core Principles?

Page 34: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Independent Deployability

Core Principles?

Page 35: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Independent Deployability

One Artifact For All Environments

Core Principles?

Page 36: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Independent Deployability

One Artifact For All Environments

Same Deployment Process Everywhere

Core Principles?

Page 37: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Artifacts

Core Principles

Platforms

Page 38: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

What do we want from an artifact?

Page 39: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

What do we want from an artifact?

Page 40: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

What do we want from an artifact?

Easy to create

Page 41: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

What do we want from an artifact?

Easy to deploy

Easy to create

Page 42: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

What do we want from an artifact?

Easy to deploy

Abstract out the tech stack

Easy to create

Page 43: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

What do we want from an artifact?

Easy to deploy

Abstract out the tech stack

Good for dev, good for ops

Easy to create

Page 44: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Tarballs

Page 45: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Tarballs

Giant bundles of stuff

Page 46: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Tarballs

Easy to create

Easy to deploy

Abstract out the tech stack

Good for dev, good for ops

Page 47: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Tarballs

Easy to create!

Easy to deploy

Abstract out the tech stack

Good for dev, good for ops

Page 48: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Tarballs

Easy to create!

Easy to deploy"

Abstract out the tech stack

Good for dev, good for ops

Page 49: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Tarballs

Easy to create!

Easy to deploy"

Abstract out the tech stack#

Good for dev, good for ops

Page 50: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Tarballs

Easy to create!

Easy to deploy"

Abstract out the tech stack#

Good for dev, good for ops"

Page 51: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Stack-specific

Page 52: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Stack-specific

nuget

jar

pip

gems

Page 53: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Stack-specific

Easy to create

Abstract out the tech stack

Easy to deploy

Good for dev, good for ops

Page 54: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Stack-specific

Easy to create!

Abstract out the tech stack

Easy to deploy

Good for dev, good for ops

Page 55: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Stack-specific

Easy to create!

Abstract out the tech stack

Easy to deploy#

Good for dev, good for ops

Page 56: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Stack-specific

Easy to create!

Abstract out the tech stack"

Easy to deploy#

Good for dev, good for ops

Page 57: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Stack-specific

Easy to create!

Abstract out the tech stack"

Easy to deploy#

Good for dev, good for ops"

Page 58: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Everything in Go is Awesome

Page 59: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Everything in Go is Awesome

FACT

Page 60: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

OS-Specific

Page 61: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

OS-Specific

$ sudo apt-get install myservice

Page 62: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

OS-Specific

$ sudo apt-get install myservice

$ deploy Returns v456 Production

Page 63: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

OS-Specific

Easy to deploy

Easy to create

Abstract out the tech stack

Good for dev, good for ops

Page 64: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

OS-Specific

Easy to deploy

Easy to create"

Abstract out the tech stack

Good for dev, good for ops

Page 65: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

OS-Specific

Easy to deploy!

Easy to create"

Abstract out the tech stack

Good for dev, good for ops

Page 66: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

OS-Specific

Easy to deploy!

Easy to create"

Abstract out the tech stack!

Good for dev, good for ops

Page 67: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

OS-Specific

Easy to deploy!

Easy to create"

Abstract out the tech stack!

Good for dev, good for ops#

Page 68: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Build

Page 69: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Build

Deb Repo

Page 70: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Host

Build

Deb Repo

Page 71: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Host

Build

Deb Repo

Page 72: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Host

Build

Deb Repo

Page 73: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Page 74: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

A v1.5

Page 75: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

A v2.1

A v1.5

Page 76: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

A v2.1

A v1.5

Page 77: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Host

Page 78: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Host

Page 79: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Host Host

Host Host

Page 80: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Host Host

Host Host

Independent Execution Environments FTW!

Page 81: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Custom Images

Easy to deploy

Easy to create

Abstract out the tech stack

Good for dev, good for ops

Page 82: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Custom Images

Easy to deploy

Easy to create#

Abstract out the tech stack

Good for dev, good for ops

Page 83: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Custom Images

Easy to deploy#

Easy to create#

Abstract out the tech stack

Good for dev, good for ops

Page 84: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Custom Images

Easy to deploy#

Easy to create#

Abstract out the tech stack

Good for dev, good for ops

!

Page 85: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Custom Images

Easy to deploy#

Easy to create#

Abstract out the tech stack

Good for dev, good for ops

!

#

Page 86: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Page 87: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Page 88: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Cost of isolated hosts is reduced…

Page 89: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Cost of isolated hosts is reduced…

…in terms of effort…

Page 90: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Cost of isolated hosts is reduced…

…in terms of effort…

…and computing resources

Page 91: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Docker!

Easy to deploy

Abstract out the tech stack

Good for dev, good for ops

Easy to create

Page 92: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Docker!

Easy to deploy

Abstract out the tech stack

Good for dev, good for ops

Easy to create#

Page 93: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Docker!

Easy to deploy

Abstract out the tech stack

Good for dev, good for ops

Easy to create

!

#

Page 94: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Docker!

Easy to deploy

Abstract out the tech stack

Good for dev, good for ops

Easy to create

!

!

#

Page 95: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Docker!

Easy to deploy

Abstract out the tech stack

Good for dev, good for ops

Easy to create

!

!

#

#

Page 96: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Artifacts

Core Principles

Platforms

Page 97: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

What do we want from our deployment platform?

Page 98: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

What do we want from our deployment platform?

Separate artifact from topology

Page 99: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

What do we want from our deployment platform?

Separate artifact from topology

Makes handling lots of services easy!

Page 100: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

What do we want from our deployment platform?

Separate artifact from topology

Makes handling lots of services easy!

Supports docker images

Page 101: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Deployment Platforms?

Page 102: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Docker Swarm

Page 103: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Docker Swarm

Page 104: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Docker Swarm

Page 105: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Docker Swarm

Page 106: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

DOCKER SWARM

Page 107: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

DOCKER SWARM

Swarm Manager

Page 108: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

DOCKER SWARM

Swarm Node Swarm Node Swarm Node

Swarm Manager

Page 109: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

DOCKER SWARM

Swarm Node Swarm Node Swarm Node

Swarm Manager

Page 110: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

DOCKER SWARM

Swarm Node Swarm Node Swarm Node

Swarm Manager

$ docker …

Page 111: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

DOCKER SWARM

Swarm Node Swarm Node Swarm Node

Swarm Manager

$ docker …

Page 112: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

DOCKER SWARM

Swarm Node Swarm Node Swarm Node

Swarm Manager

$ docker …

Page 113: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

DOCKER SWARM

Swarm Node Swarm Node Swarm Node

Swarm Manager

$ docker …

Page 114: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

SCHEDULING STRATEGIES - BINPACK

Swarm Node Swarm Node Swarm Node

Swarm Manager

Page 115: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

SCHEDULING STRATEGIES - BINPACK

Swarm Node Swarm Node Swarm Node

Swarm Manager

Page 116: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

SCHEDULING STRATEGIES - SPREAD

Swarm Node Swarm Node Swarm Node

Swarm Manager

Page 117: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

SCHEDULING STRATEGIES - SPREAD

Swarm Node Swarm Node Swarm Node

Swarm Manager

Page 118: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

DOCKER COMPOSE

web: build: . ports: - "5000:5000" volumes: - .:/code links: - redis

redis: image: redis

Page 119: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Page 120: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Doesn’t rebalance

Page 121: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Doesn’t rebalance

Doesn’t restart failed containers

Page 122: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Doesn’t rebalance

Doesn’t restart failed containers

Does

Page 123: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Doesn’t rebalance

Doesn’t restart failed containers

Does

Does

Page 124: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Doesn’t rebalance

Doesn’t restart failed containers

Plays nice with the rest of docker

Does

Does

Page 125: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Doesn’t rebalance

Doesn’t restart failed containers

Plays nice with the rest of docker

Case studies thin on the ground

Does

Does

Page 126: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Page 127: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Mesos Master

MESOS

Page 128: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Mesos Master

MESOS

Page 129: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Mesos Master

Mesos Agent Mesos Agent Mesos Agent

MESOS

Page 130: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Frameworks!

Page 131: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Page 132: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Frameworks

Page 133: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Frameworks

Scheduler

Page 134: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Frameworks

Scheduler Executor

Page 135: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Mesos Master

Mesos Agent Mesos Agent Mesos Agent

MESOS

Page 136: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Mesos Master

Mesos Agent Mesos Agent Mesos Agent

MESOSHadoop Scheduler

Page 137: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Mesos Master

Mesos Agent Mesos Agent Mesos Agent

MESOS

Hadoop Executor

Hadoop Scheduler

Page 138: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Mesos Master

Mesos Agent Mesos Agent Mesos Agent

MESOS

Hadoop Executor

Hadoop Scheduler

Page 139: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Mesos Master

Mesos Agent Mesos Agent Mesos Agent

MESOS

Hadoop Executor

Hadoop Scheduler

Hadoop

Page 140: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Mesos Master

Mesos Agent Mesos Agent Mesos Agent

MESOS

Hadoop Executor

Hadoop Scheduler

Hadoop

Marathon

Marathon

Page 141: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Mesos Master

Mesos Agent Mesos Agent Mesos Agent

MESOS

Hadoop Executor

Hadoop Scheduler

Hadoop

Marathon

Marathon

Marathon Scheduler

Page 142: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Mesos Master

Mesos Agent Mesos Agent Mesos Agent

MESOS

Hadoop Executor

Hadoop Scheduler

Hadoop

Marathon

Marathon

Marathon Scheduler

Page 143: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

OTHER FRAMEWORKS…

https://github.com/alde/eremetic

Page 144: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

AWS Lambda

Page 145: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Page 146: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Great if you need to run other workloads

Page 147: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Great if you need to run other workloads

Really powerful - fully featured, widely used

Page 148: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Great if you need to run other workloads

Really powerful - fully featured, widely used

Fairly complex - lots of moving parts

Page 149: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Page 150: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Page 151: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

KUBERNETES ARCHITECTURE…SORT OF

Page 152: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

API Server

KUBERNETES ARCHITECTURE…SORT OF

Page 153: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

API Server

KUBERNETES ARCHITECTURE…SORT OF

Page 154: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

API Server

Kubelet Kubelet Kubelet

KUBERNETES ARCHITECTURE…SORT OF

Page 155: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

API Server

Kubelet Kubelet Kubelet

$ kubectl …

KUBERNETES ARCHITECTURE…SORT OF

Page 156: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

API Server

Kubelet Kubelet Kubelet

$ kubectl …

KUBERNETES ARCHITECTURE…SORT OF

Page 157: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

PODS?

Page 158: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

A collection of tightly coupled containers, running on one node

PODS?

Page 159: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

A collection of tightly coupled containers, running on one node

PODS?

Can have metadata, volumes too

Page 160: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

A collection of tightly coupled containers, running on one node

PODS?

Can have metadata, volumes too

Pods are mortal - not long running!

Page 161: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

A collection of tightly coupled containers, running on one node

PODS?

Can have metadata, volumes too

Pods are mortal - not long running!

A pod = a unit of scheduling

Page 162: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

SERVICES!

Page 163: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

SERVICES!

{ "kind": "Service", "apiVersion": "v1", "metadata": { "name": "my-service" }, "spec": { "selector": { "app": "MyApp" }, "ports": [ { "protocol": "TCP", "port": 80, "targetPort": 9376 } ] }}

Page 164: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

SERVICES!

A mapping of metadata and ports

to a set of pods

{ "kind": "Service", "apiVersion": "v1", "metadata": { "name": "my-service" }, "spec": { "selector": { "app": "MyApp" }, "ports": [ { "protocol": "TCP", "port": 80, "targetPort": 9376 } ] }}

Page 165: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Kubelet

Page 166: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Kubelet

Page 167: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Kubelet

Page 168: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Kubelet

Service Proxy

Page 169: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Kubelet

Service Proxy

:80

Page 170: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

You don’t scale a service…

Kubelet

Service Proxy

:80

Page 171: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

You don’t scale a service…

…you scale the pods!

Kubelet

Service Proxy

:80

Page 172: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Page 173: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Simpler to setup than Mesos - but more single purpose too

Page 174: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Simpler to setup than Mesos - but more single purpose too

Closer to a PAAS

Page 175: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Simpler to setup than Mesos - but more single purpose too

Closer to a PAAS

Pods can be confusing!

Page 176: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Simpler to setup than Mesos - but more single purpose too

Closer to a PAAS

Fairly new, but a growing amount of impressive support

Pods can be confusing!

Page 177: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Docker Swarm

Page 178: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Docker Swarm

Page 179: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Docker Swarm

Page 180: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Docker Swarm

Page 181: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Page 182: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Core Principles

Page 183: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Core Principles

Independent Deployability

Page 184: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Core Principles

One Artifact For All Environments

Independent Deployability

Page 185: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Core Principles

One Artifact For All Environments

Independent Deployability

Same Deployment

Process

Page 186: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Core Principles

One Artifact For All Environments

Independent Deployability

Same Deployment

Process

Docker Images As Artifacts

Page 187: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Core Principles

One Artifact For All Environments

Independent Deployability

Same Deployment

Process

Docker Images As Artifacts

Criteria For Selecting A Platform

Page 188: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Page 189: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman

Sam Newman

Building MicroservicesDESIGNING FINE-GRAINED SYSTEMS

AUTHD

http://samnewman.io/podcast

Page 190: Deploying And Scaling Microservices - CraftConf...AWS Lambda @samnewman @samnewman Great if you need to run other workloads @samnewman Great if you need to run other workloads Really

@samnewman [email protected]

THANKS!