why should i care about stateful containers?

40
Why should I care about stateful containers? Luke Marsden CTO, ClusterHQ @lmarsden @clusterhq

Upload: clusterhq

Post on 11-Apr-2017

543 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Why should i care about stateful containers?

Why should I care about stateful containers?

Luke MarsdenCTO, ClusterHQ

@lmarsden @clusterhq

Page 2: Why should i care about stateful containers?

Microservices are smashing up monolithic databases

Many more database instances, many more flavours

prod

staging in cloud 2

DR in cloud 3

hosted CIdev

laptop

Page 3: Why should i care about stateful containers?

Aren’t containers stateless?

12 factor apps

Page 4: Why should i care about stateful containers?

One platform

Page 5: Why should i care about stateful containers?

Dev/prod parity

Page 6: Why should i care about stateful containers?

Cloud services are effectively closed source

Page 7: Why should i care about stateful containers?

Portability

Page 8: Why should i care about stateful containers?

OK, who’s in?

Page 9: Why should i care about stateful containers?

Cattle vs. petsDeep dive

Page 10: Why should i care about stateful containers?

compute

local storage

infrastructure evolution1990s

servers with disks in

Servers Volumes

Pets Pets

Cattle Pets

Cattle Cattle

Page 11: Why should i care about stateful containers?

SAN storage

VM VM VM

infrastructure evolution2000s

vol vol vol

VMware hosts

virtualisation and shared storage

Servers Volumes

Pets Pets

Cattle Pets

Cattle Cattle

Page 12: Why should i care about stateful containers?

EBS

VM VM VM

infrastructure evolution2010s

cloudVMs no longer HA

vol vol vol

EC2Servers Volumes

Pets Pets

Cattle Pets

Cattle Cattle

Page 13: Why should i care about stateful containers?

infrastructure evolution2010s

computelocal storage

on-prem “hyperconverged” or “SDS”eg OpenStack + Ceph or ScaleIO

VM

vol vol

Servers Volumes

Pets Pets

Cattle Pets

Cattle Cattle

Page 14: Why should i care about stateful containers?

infrastructure evolution2010s

computelocal storage

distributed databasesbare metal / cloud VMs + local storage

db

Servers Volumes

Pets Pets

Cattle Pets

Cattle Cattle

db

Page 15: Why should i care about stateful containers?

infrastructure evolution2010s

computelocal storage

distributed databases on SDS

vol vol

Servers Volumes

Pets Pets

Cattle Pets

Cattle Cattle

db db

Page 16: Why should i care about stateful containers?

infrastructure evolution2015

computelocal storage

distributed databases on SDSin container clusters

vol vol

Servers Volumes

Pets Pets

Cattle Pets

Cattle Cattle

db db

container scheduler

Page 17: Why should i care about stateful containers?

Servers Volumes What is it?

Pets Pets just crap

Cattle Pets storage orchestration

Cattle Cattleephemeral

stateful containers

Pet ~= HA provided by infrastructure/platformCattle ~= HA provided by application

Page 18: Why should i care about stateful containers?

Pros & consStorage orchestration• Run any database/stateful app• Storage layer responsible for

data resilience• Ops independent of database

types• Works within a storage zone

Ephemeral stateful containers• Requires distributed database(s)• Database-defined data resilience• Ops requires understanding each

data service• Can span storage zones

Page 19: Why should i care about stateful containers?

Ephemeral stateful

Page 20: Why should i care about stateful containers?

Storage orchestration

Page 21: Why should i care about stateful containers?

Why should data be pets when servers are cattle?

Page 22: Why should i care about stateful containers?
Page 23: Why should i care about stateful containers?
Page 24: Why should i care about stateful containers?

Relocatable

EBS/SDS/SAN…

Page 25: Why should i care about stateful containers?

Stateless things scale outStateful things scale up

Container can be a shard

Page 26: Why should i care about stateful containers?

You can mix and match stateful + stateless in a

container cluster

Page 27: Why should i care about stateful containers?

Use case: rebalance cluster

storagev1

compute

containerhost

(VM orbare metal)

c1 c2

container composer + scheduler + SD

v2

Page 28: Why should i care about stateful containers?

Use case: rebalance cluster

storagev1

compute

containerhost

(VM orbare metal)

c1 c2

v2

container composer + scheduler + SD

Page 29: Why should i care about stateful containers?

Use case: drain a node

storagev1

compute

containerhost

(VM orbare metal)

c1 c2

v2 v3

c3 c4

v4

container composer + scheduler + SD

Page 30: Why should i care about stateful containers?

Use case: drain a node

storage

compute

containerhost

(VM orbare metal)

v3

c3 c4

v4

v1

c1 c2

v2

container composer + scheduler + SD

Page 31: Why should i care about stateful containers?

Use case: drain a node

storage

compute

containerhost

(VM orbare metal)

v3

c3 c4

v4

v1

c1 c2

v2

container composer + scheduler + SD

Page 32: Why should i care about stateful containers?

Use case: HA when node fails

storagev1

compute

containerhost

(VM orbare metal)

c1

container composer + scheduler + SD

Page 33: Why should i care about stateful containers?

Use case: HA when node fails

storagev1

compute

containerhost

(VM orbare metal)

container composer + scheduler + SD

Page 34: Why should i care about stateful containers?

Use case: HA when node fails

storagev1

compute

containerhost

(VM orbare metal)

c1

container composer + scheduler + SD

Page 35: Why should i care about stateful containers?

Use case: speed up distributed database recovery

storagev1

compute

containerhost

(VM orbare metal)

c1

container composer + scheduler + SD

c2

container overlay network

v2

10.0.0.1 10.0.0.2

c3

v3

10.0.0.3

Page 36: Why should i care about stateful containers?

Use case: speed up distributed database recovery

storagev1

compute

containerhost

(VM orbare metal)

c1

container composer + scheduler + SD

c2

container overlay network

v2

10.0.0.1 10.0.0.2

c3

v3

10.0.0.3

Page 37: Why should i care about stateful containers?

Use case: speed up distributed database recovery

storagev1

compute

containerhost

(VM orbare metal)

container composer + scheduler + SD

c2

container overlay network

v2

10.0.0.2

c3

v3

10.0.0.3

Page 38: Why should i care about stateful containers?

Use case: speed up distributed database recovery

storagev1

compute

containerhost

(VM orbare metal)

container composer + scheduler + SD

c2

container overlay network

v2

10.0.0.2

c3

v3

10.0.0.3

c110.0.0.1

Page 39: Why should i care about stateful containers?

Connecting storage to containers

Page 40: Why should i care about stateful containers?

Try Flocker todayFor stateful microservices

[email protected]

github.com/clusterhq/flocker

We are hiring in Bristol (1 hour hop from Schiphol)+ SF Bay Area!

clusterhq.com/careers