Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Zero Downtime Deployment Golden Rules

Zero Downtime Deployment Golden Rules

I T.A.K.E Unconference 2016 (Bucharest, Romania)

3a53a5136f530c121a196914aecf3936?s=128

Tugberk Ugurlu

May 20, 2016
Tweet

Transcript

  1. Zero Downtime Deployment Golden Rules Tugberk Ugurlu Redgate Software @tourismgeek

    http://tugberkugurlu.com #itakeunconf
  2. @tourismgeek tugberkugurlu.com github.com/tugberkugurlu stackoverflow.com/users/463785/tugberk

  3. @redgate

  4. #itakeunconf Example HTTP APIs v1 Example Android iPhone Example Android

    Client Example Web Client Example HTTP APIs v1.1
  5. Why Should I Care? #itakeunconf

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

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

  8. Continuous Delivery #itakeunconf

  9. #itakeunconf

  10. Type of Products #itakeunconf

  11. Type of Applications • HTTP Services • Web Sites #itakeunconf

  12. None
  13. Write Down the Deployment Strategy #itakeunconf

  14. #itakeunconf

  15. Script out the Deployment Strategy #itakeunconf

  16. #itakeunconf

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

  18. #itakeunconf

  19. True Staging Environment #itakeunconf

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

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

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

  23. Drain Requests #itakeunconf

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

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

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

  27. 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
  28. 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
  29. Minor-Patch Releases • No breaking changes #itakeunconf

  30. 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
  31. DEMO https://github.com/tugberkugurlu/aspnetcoresamples/tree/itakeu16/haproxy-zero-downtime-sample #itakeunconf

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

  33. 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
  34. 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

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

  36. Major Releases • Breaking Changes • First Major Release •

    Non-first Major Releases #itakeunconf
  37. 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
  38. Prefer Fast-forward Database Changes #itakeunconf

  39. #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
  40. Do Not Override Client Side Assets #itakeunconf

  41. #itakeunconf v1 v1.1

  42. #itakeunconf v1 v1.1

  43. Be Aware of the Context #itakeunconf

  44. Be Aware of the Context • Cookies • Sessions •

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

  46. Helpful Tools • HAProxy • Octopus Deploy • node-semver CLI

    • Docker • Docker Cloud (a.k.a. Tutum) • DLM Automation Tools from Redgate #itakeunconf