20 Minutes to Production Zero Downtime Paul Payne @paulrpayne - - PowerPoint PPT Presentation

20 minutes to production
SMART_READER_LITE
LIVE PREVIEW

20 Minutes to Production Zero Downtime Paul Payne @paulrpayne - - PowerPoint PPT Presentation

20 Minutes to Production Zero Downtime Paul Payne @paulrpayne http://payne.io Presentation code can be found at: github.com/payneio/qcon-gtin.git Photos from http://unsplash.com . GTIN (bar code) Product Lookup Service 18 million


slide-1
SLIDE 1

20 Minutes to Production

Zero Downtime Paul Payne

@paulrpayne http://payne.io

Presentation code can be found at:

github.com/payneio/qcon-gtin.git

Photos from http://unsplash.com.

slide-2
SLIDE 2
slide-3
SLIDE 3

GTIN (bar code) Product Lookup Service

18 million products.

slide-4
SLIDE 4

We need this change right now!

slide-5
SLIDE 5

Three Parts

  • 1. Microservices

Coding with confidence.

  • 2. Containers

Sensible units of deployment.

  • 3. Deployment

Patterns for zero downtime.

slide-6
SLIDE 6

Part One

  • 1. Microservices

Coding with confidence.

  • 2. Containers

Sensible units of deployment.

  • 3. Deployment

Patterns for zero downtime.

slide-7
SLIDE 7

Microservices

Single responsibility. Minimal, easily understood code. Loosely coupled.

  • Modular. Composable.

Maintain their own state.

Independently deployable functionality

=

µ

slide-8
SLIDE 8

Microservice Quality Assurance

Liberal in what you accept. Conservative in what you send (Robustness Principle). Fast errors (compile time vs. run time). Fast compile, build, test iterations. TDD. Confidence.

slide-9
SLIDE 9

Demo

In which the presenter demonstrates an update to the microservice with defensive coding practices and fast build and test steps with the aid of Go.

slide-10
SLIDE 10

Part Two

  • 1. Microservices

Coding with confidence.

  • 2. Containers

Sensible units of deployment.

  • 3. Deployment

Patterns for zero downtime.

slide-11
SLIDE 11

Application Containers

“An application container is a way of packaging and executing processes on a computer system that isolates the application from the underlying host

  • perating system” —https://github.com/appc/spec, 2015.

brought into the kernel... namespaces cgroups SELinux AppArmor btrs/aufs/device mapper/etc ... Various projects... chroot (1979) jail Linux-VServer OpenVZ ... and packaged up. systemd-nspawn LXC lmctfy libvirt-lxc Docker / libcontainer rkt / appc ...

slide-12
SLIDE 12

Virtualization Overhead

Bare Metal Host OS (Linux) Hypervisor Guest OS bins/libs App A Guest OS bins/libs App B Bare Metal Host OS (Linux) Container Engine bins/libs App A bins/libs App B VM Container

slide-13
SLIDE 13

Better Hardware Utilization

Virtual Machines Containers

slide-14
SLIDE 14

The Right Abstraction for Software

slide-15
SLIDE 15

Immutable Infrastructure

Analogy from Bill Baker, Microsoft

Microservices

slide-16
SLIDE 16

Clean Org Interface (Reverse Conway’s Law)

Installing and configuring VMs. Configuring app environments. Creating, building and installing apps. Making VM snapshots. Installing OS updates. Installing and configuring hardware. Distributing VMs. Monitoring and fixing hardware. Working with devs on bad VMs. Configuring app environments. Creating, building and installing apps. Installing and configuring hardware. Distributing containers. Monitoring and fixing hardware. Rejecting bad containers. The mythical DevOPS unicorn

The DevOPS continuum

VMs Containers

OPS Dev

slide-17
SLIDE 17

Demo

$ make In which the presenter demonstrates the simple containerization of the microservice using Docker and make.

slide-18
SLIDE 18

Part Three

  • 1. Microservices

Coding with confidence.

  • 2. Containers

Sensible units of deployment.

  • 3. Deployment

Patterns for zero downtime.

slide-19
SLIDE 19

The Datacenter as a Computer

Luiz Barroso & Urs Hölzle (2009).

http://doi.org/10.2200/S00516ED2V01Y201306CAC024

slide-20
SLIDE 20

A Virtual Machine Detour on the Cluster Scheduling Timeline

1999 VMWare 2003 Xen 2006 EC2 2009 Eucalyptus 2013 Docker CoreOS Mesos Marathon Google Omega LXC 0.9 2012 OpenStack 2014 Kubernetes 2009 Mesos 2015 Docker Swarm 2003 Google Borg Late 1960s Mainframe Job Control Multics Burroughs B5700 1977 ARCnet 1984 VAXcluster 2001 HP Utility Data Center 1994 IBM S/390 Parallel Sysplex 2006 cgroups 2008 LXC namespaces OpenVZ jails Solaris zones

slide-21
SLIDE 21

Cluster Schedulers, aka Microservice Platforms

docker + swarm + compose

DCOS

slide-22
SLIDE 22

A Microservice Platform Pattern

Visible/Volatile/Persistent —Peter Gillardmoss, 2012 Phoenix servers —Martin Fowler, 2012

VISIBLE VOLATILE PERSISTENT

slide-23
SLIDE 23

Live Deployment

Blue-Green Deploy Rolling Deploy Canary Deploy

Jez Humble and David Farley (2010). Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation, Addison-Wesley.

slide-24
SLIDE 24

The General Deployment Story

VISIBLE VOLATILE

1 2 3

Public Private

1 2 3

slide-25
SLIDE 25

Demo

etcd fleetctl GTIN GTIN GTIN Public Private In which the presenter demonstrates a canary and rolling deploy with zero downtime using CoreOS and Vulcand.

slide-26
SLIDE 26
slide-27
SLIDE 27

The Result

GTIN Win!

slide-28
SLIDE 28

Other Reactions

“Wait! You’re not deploying to production NOW are you??!” “I think we found a bug in the system.”

slide-29
SLIDE 29

Three Parts

  • 1. Microservices

Coding with confidence.

  • 2. Containers

Sensible units of deployment.

  • 3. Deployment

Patterns for zero downtime.

slide-30
SLIDE 30

Getting There

Part Four (surprise!)

slide-31
SLIDE 31

Infrastructure as Code

Quick reproducible infrastructure. Entire Blue/Green stacks. Cattle, not pets!

Deployment Manager

Google Cloud Platform Amazon Web Services

Terraform

Cross-platform

CloudFormation

slide-32
SLIDE 32

Anti-Corruption Layers

Each service manages its own data;

  • ie. maintains its own table.

Integrate through interfaces, not data stores! Our canonical GTIN data is kept in a commercial enterprise product. We copy the data we need for our service to Dynamo, syncing daily.

slide-33
SLIDE 33

Wrap a proxy layer around the entire enterprise application. Route requests to your microservices as you bring them

  • nline.

Someday, none of your legacy app will remain.

Application Strangler

http://martinfowler.com/bliki/StranglerApplication.html. Image by http://journals.worldnomads.com/beckandphil.

slide-34
SLIDE 34

Build to Learn

slide-35
SLIDE 35

20 Minutes to Production

Zero Downtime Paul Payne

@paulrpayne http://payne.io

Presentation code can be found at:

github.com/payneio/qcon-gtin.git

Photos from http://unsplash.com.

slide-36
SLIDE 36