Getting Into the Zero Downtime Deployment World

Getting Into the Zero Downtime Deployment World

NDC Oslo 2016 (Oslo, Norway)

3a53a5136f530c121a196914aecf3936?s=128

Tugberk Ugurlu

June 10, 2016
Tweet

Transcript

  1. Getting Into the Zero Downtime Deployment World Tugberk Ugurlu Redgate

    Software @tourismgeek tugberkugurlu.com #ndcoslo https://flic.kr/p/fNTDM1
  2. What is This? #ndcoslo https://flic.kr/p/cdvAaj

  3. #ndcoslo Example HTTP APIs v1 Example Android iPhone Example Android

    Client Example Web Client Example HTTP APIs v1.1
  4. Should I Care? #ndcoslo https://flic.kr/p/e7oMGm

  5. #ndcoslo https://flic.kr/p/49FHd3

  6. https://twitter.com/tourismgeek/status/580270772402393088 #ndcoslo

  7. A Sample Case #ndcoslo

  8. None
  9. LB zleek-0 zleek-1 zleek-n mongodb neo4j elasticsearch rabbitmq recipe-generation-worker-0 recipe-sync-worker-0

    food-sync-worker-0 store-sync-worker-0 recipe-generation-worker-1 recipe-generation-worker-n recipe-sync-worker-n recipe-sync-worker-0
  10. Continuous Delivery #ndcoslo https://flic.kr/p/bzG7ds

  11. #ndcoslo https://gist.github.com/revett/99d8a5143c0bfeddfc92 Our Target

  12. Our Scope #ndcoslo

  13. Type of Applications • HTTP Services • Web Sites #ndcoslo

  14. #ndcoslo https://flic.kr/p/mRRFdH The Path and Guidance

  15. Write Down the Deployment Strategy #ndcoslo https://flic.kr/p/pd4X4A

  16. #ndcoslo

  17. Script out the Deployment Strategy https://flic.kr/p/79EVn6

  18. #ndcoslo

  19. Release Management Software https://octopus.com/ #ndcoslo

  20. #ndcoslo

  21. True Staging Environment #ndcoslo

  22. example-api-v0-6786234 example-api- process example-api-v0-6327638 example-api- process Router v0.example.com

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

  24. Router v0.example.com #ndcoslo example-api-v0-6327638 example-api- process example-api-v0-6786234 example-api- process

  25. Drain Requests #ndcoslo https://flic.kr/p/79A7Db

  26. Router v0.example.com #ndcoslo example-api-v0-6327638 example-api- process example-api-v0-6786234 example-api- process

  27. Router v0.example.com #ndcoslo example-api-v0-6327638 example-api- process example-api-v0-6786234 example-api- process

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

  29. 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 #ndcoslo
  30. 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 #ndcoslo
  31. Minor-Patch Releases • No breaking changes #ndcoslo

  32. example-api-v0-6327638 example-api-v0-7814219 example-api-v0-9528392 LB v0.example.com example-api- process example-api- process example-api-

    process example-api-v0-6786234 example-api-v0-3266280 example-api-v0-8429842 example-api- process example-api- process example-api- process
  33. DEMO https://github.com/tugberkugurlu/AspNetCoreSamples/tree/ndcoslo2016/haproxy-zero-downtime-sample #ndcoslo

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

  35. Internal LB-1 LB-1 Internal LB-2 server1 server2 server3 server4 server5

    server6 server7 server8 server9 server10 client client client client client client #ndcoslo
  36. 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/ #ndcoslo

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

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

    Non-first Major Releases #ndcoslo
  39. 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
  40. Prefer Fast-forward Database Changes #ndcoslo

  41. #ndcoslo Id Make M 1 Renault Cl 2 Mercedes GL

    3 Volkswagen Po 4 Toyota Ya v1 v2 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
  42. Do Not Override Client Side Assets #ndcoslo

  43. #ndcoslo v1 v1.1

  44. #ndcoslo v1 v1.1

  45. Be Aware of the Context #ndcoslo

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

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

  48. Helpful Tools • Git (https://git-scm.com) • Travis CI (https://travis-ci.org) •

    Octopus Deploy (https://octopus.com) • HAProxy (http://haproxy.org) • node-semver CLI (http://bit.ly/1PO6hvR) • Docker (https://docker.com) • Docker Cloud (a.k.a. Tutum, http://bit.ly/1RYYtl2) • SQL Server Data Tools (SSDT, http://bit.ly/1P7qETh) • DLM Automation Tools from Redgate (http://bit.ly/1VQ2rDm) #ndcoslo
  49. @tourismgeek github.com/tugberkugurlu linkedin.com/in/tugberk https://flic.kr/p/edfM1R