Slide 1

Slide 1 text

Zero Downtime Deployment Golden Rules Tugberk Ugurlu Redgate Software @tourismgeek http://tugberkugurlu.com #itakeunconf

Slide 2

Slide 2 text

@tourismgeek tugberkugurlu.com github.com/tugberkugurlu stackoverflow.com/users/463785/tugberk

Slide 3

Slide 3 text

@redgate

Slide 4

Slide 4 text

#itakeunconf Example HTTP APIs v1 Example Android iPhone Example Android Client Example Web Client Example HTTP APIs v1.1

Slide 5

Slide 5 text

Why Should I Care? #itakeunconf

Slide 6

Slide 6 text

http://customers.agriya.com/products/private-shop/features/maintenance-course #itakeunconf

Slide 7

Slide 7 text

https://twitter.com/tourismgeek/status/580270772402393088 #itakeunconf

Slide 8

Slide 8 text

Continuous Delivery #itakeunconf

Slide 9

Slide 9 text

#itakeunconf

Slide 10

Slide 10 text

Type of Products #itakeunconf

Slide 11

Slide 11 text

Type of Applications • HTTP Services • Web Sites #itakeunconf

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Write Down the Deployment Strategy #itakeunconf

Slide 14

Slide 14 text

#itakeunconf

Slide 15

Slide 15 text

Script out the Deployment Strategy #itakeunconf

Slide 16

Slide 16 text

#itakeunconf

Slide 17

Slide 17 text

Release Management Software https://octopus.com/ #itakeunconf

Slide 18

Slide 18 text

#itakeunconf

Slide 19

Slide 19 text

True Staging Environment #itakeunconf

Slide 20

Slide 20 text

example-api-v0-6786234 example Products example-api-v0-6327638 example Products Router v0.example.com

Slide 21

Slide 21 text

Blue-green Deployment http://martinfowler.com/bliki/BlueGreenDeployment.html #itakeunconf

Slide 22

Slide 22 text

Router v0.example.com #itakeunconf example-api-v0-6327638 example Products example-api-v0-6786234 example Products

Slide 23

Slide 23 text

Drain Requests #itakeunconf

Slide 24

Slide 24 text

Router v0.example.com #itakeunconf example-api-v0-6327638 example Products example-api-v0-6786234 example Products

Slide 25

Slide 25 text

Router v0.example.com #itakeunconf example-api-v0-6327638 example Products example-api-v0-6786234 example Products

Slide 26

Slide 26 text

SemVer Your Software http://www.tugberkugurlu.com/archive/versioning-software-builds-based-on-git-tags-and-semantic-versioning-semver #itakeunconf

Slide 27

Slide 27 text

SemVer Your Software • See semver.org • Support 2 Major versions of the HTTP Service, not 1, not 3. • Define a support policy for support lifetime for versions #itakeunconf

Slide 28

Slide 28 text

Type of Changes • Patch: No user facing changes, all internal. • Minor: Add functionality in a backwards-compatible manner • Major: Introducing incompatible changes • See semver.org for more information #itakeunconf

Slide 29

Slide 29 text

Minor-Patch Releases • No breaking changes #itakeunconf

Slide 30

Slide 30 text

example-api-v0-6327638 example-api-v0-7814219 example-api-v0-9528392 LB v0.example.com example Products example Products example Products example-api-v0-6786234 example-api-v0-3266280 example-api-v0-8429842 example Products example Products example Products

Slide 31

Slide 31 text

DEMO https://github.com/tugberkugurlu/aspnetcoresamples/tree/itakeu16/haproxy-zero-downtime-sample #itakeunconf

Slide 32

Slide 32 text

HAProxy Config Reload http://engineeringblog.yelp.com/2015/04/true-zero-downtime-haproxy-reloads.html #itakeunconf

Slide 33

Slide 33 text

Internal LB-1 LB-1 Internal LB-2 server1 server2 server3 server4 server5 server6 server7 server8 server9 server10 client client client client client client #itakeunconf

Slide 34

Slide 34 text

Multiple Load Balancer Nodes http://robert.penz.name/386/howto-setup-a-haproxy-as-fault-tolerant-high-available-load-balancer-for-multiple-caching-web-proxies-on-rhelcentossl/ #itakeunconf

Slide 35

Slide 35 text

#itakeunconf http://robert.penz.name/386/howto-setup-a-haproxy-as-fault-tolerant-high-available-load-balancer-for-multiple-caching-web-proxies-on-rhelcentossl/

Slide 36

Slide 36 text

Major Releases • Breaking Changes • First Major Release • Non-first Major Releases #itakeunconf

Slide 37

Slide 37 text

example-api-v0-6327638 example-api-v0-7814219 example-api-v0-9528392 LB v0.example.com example Products example Products example Products example-api-v1-2276168 example-api-v1-5677802 example Products example Products LB v1.example.com example-api-v1-7182721 example Products

Slide 38

Slide 38 text

Prefer Fast-forward Database Changes #itakeunconf

Slide 39

Slide 39 text

#itakeunconf Id Make Model Colour 1 Renault Clio Red 2 Mercedes GLA Black 3 Volkswagen Polo White 4 Toyota Yaris Yellow Id Make Model Colour 1 Renault Clio Red 2 Mercedes GLA Black 3 Volkswagen Polo White 4 Toyota Yaris Yellow v1 v2

Slide 40

Slide 40 text

Do Not Override Client Side Assets #itakeunconf

Slide 41

Slide 41 text

#itakeunconf v1 v1.1

Slide 42

Slide 42 text

#itakeunconf v1 v1.1

Slide 43

Slide 43 text

Be Aware of the Context #itakeunconf

Slide 44

Slide 44 text

Be Aware of the Context • Cookies • Sessions • Authentication Tokens

Slide 45

Slide 45 text

Sticky Sessions http://blog.haproxy.com/2012/03/29/load-balancing-affinity-persistence-sticky-sessions-what-you-need-to-know/

Slide 46

Slide 46 text

Helpful Tools • HAProxy • Octopus Deploy • node-semver CLI • Docker • Docker Cloud (a.k.a. Tutum) • DLM Automation Tools from Redgate #itakeunconf