Zero Downtim
e Deployment
Golden Rules
Tugberk UgurluRedgate
Software
@tourism
geekhttp://tugberkugurlu.com
#itakeunconf
@tourism
geek
tugberkugurlu.com
github.com/tugberkugurlu
stackoverflow.com
/users/463785/tugberk
@redgate
#itakeunconf
Example
HTTP APIsv1
Example
Android iPhone
Example
Android Client
Example
Web Client
Example
HTTP APIsv1.1
Why Should I Care?
#itakeunconf
http://customers.agriya.com
/products/private-shop/features/maintenance-course
#itakeunconf
https://twitter.com
/tourismgeek/status/580270772402393088
#itakeunconf
Continuous Delivery
#itakeunconf
#itakeunconf
Type of Products
#itakeunconf
Type of Applications
•HTTP Services
•W
eb Sites
#itakeunconf
Write Dow
n the Deployment Strategy
#itakeunconf
#itakeunconf
Script out the Deployment Strategy
#itakeunconf
#itakeunconf
Release Managem
ent Software
https://octopus.com/
#itakeunconf
#itakeunconf
True Staging Environment
#itakeunconf
example-api-v0-6786234
example
Products
example-api-v0-6327638
example
Products
Router
v0.example.com
Blue-green Deployment
http://martinfow
ler.com/bliki/BlueGreenDeploym
ent.html
#itakeunconf
Router
v0.example.com
#itakeunconf
example-api-v0-6327638
example
Products
example-api-v0-6786234
example
Products
Drain Requests
#itakeunconf
Router
v0.example.com
#itakeunconf
example-api-v0-6327638
example
Products
example-api-v0-6786234
example
Products
Router
v0.example.com
#itakeunconf
example-api-v0-6327638
example
Products
example-api-v0-6786234
example
Products
SemVerYour Softw
arehttp://w
ww
.tugberkugurlu.com/archive/versioning-softw
are-builds-based-on-git-tags-and-semantic-versioning-sem
ver
#itakeunconf
SemVerYour Softw
are
•See sem
ver.org•
Support 2 Major versions of the HTTP Service, not 1, not 3.
•Define a support policy for support lifetim
e for versions
#itakeunconf
Type of Changes
•Patch: N
o user facing changes, all internal.•
Minor: Add functionality in a backw
ards-compatible m
anner•
Major: Introducing incom
patible changes•
See semver.org for m
ore information
#itakeunconf
Minor-Patch Releases
•N
o breaking changes
#itakeunconf
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
DEMO
https://github.com/tugberkugurlu/aspnetcoresam
ples/tree/itakeu16/haproxy-zero-downtim
e-sample
#itakeunconf
HAProxy
ConfigReload
http://engineeringblog.yelp.com/2015/04/true-zero-dow
ntime-haproxy-reloads.htm
l
#itakeunconf
InternalLB-1
LB-1
InternalLB-2
server1
server2
server3
server4
server5
server6
server7
server8
server9
server10
client
client
client
client
client
client
#itakeunconf
Multiple Load Balancer N
odeshttp://robert.penz.nam
e/386/howto-setup-a-haproxy-as-fault-tolerant-high-available-load-balancer-for-m
ultiple-caching-web-proxies-on-rhelcentossl/
#itakeunconf
#itakeunconfhttp://robert.penz.nam
e/386/howto-setup-a-haproxy-as-fault-tolerant-high-available-load-balancer-for-m
ultiple-caching-web-proxies-on-rhelcentossl/
Major Releases
•Breaking Changes
•First M
ajor Release•
Non-first M
ajor Releases
#itakeunconf
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
Prefer Fast-forward Database Changes
#itakeunconf
#itakeunconf
IdM
akeM
odelColour
1Renault
ClioRed
2M
ercedesGLA
Black3
Volkswagen
PoloW
hite4
ToyotaYaris
Yellow
IdM
akeM
odelColour
1Renault
ClioRed
2M
ercedesGLA
Black3
Volkswagen
PoloW
hite4
ToyotaYaris
Yellow
v1v2
Do Not O
verride Client Side Assets
#itakeunconf
#itakeunconf
v1v1.1
#itakeunconf
v1v1.1
Be Aware of the Context
#itakeunconf
Be Aware of the Context
•Cookies
•Sessions
•Authentication Tokens
Sticky Sessionshttp://blog.haproxy.com
/2012/03/29/load-balancing-affinity-persistence-sticky-sessions-what-you-need-to-know
/
Helpful Tools
•HAProxy
•O
ctopus Deploy•
node-semverCLI
•Docker
•Docker Cloud (a.k.a. Tutum
)•
DLM Autom
ation Tools from Redgate
#itakeunconf