Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Deploying and Testing Microservices

4,885 views

Published on

Sam Newman is a technologist at ThoughtWorks. This talk from FlowCon 2014 goes into the nitty gritty of managing build, test and release of microservices and also covers the often ignored tradeoff between testing before deployment, and testing afterwards.

Published in: Technology
  • D0WNL0AD FULL ▶ ▶ ▶ ▶ http://1lite.top/AqmGY ◀ ◀ ◀ ◀
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Deploying and Testing Microservices

  1. 1. TESTING & DEPLOYING MICROSERVICES Sam Newman Flowcon, September 2014 1
  2. 2. Customer Service Accounts Returns Invoicing Shipping Inventory @flowconsf @samnewman
  3. 3. Focused around a business domain Customer Service Accounts Returns Invoicing Shipping Inventory @flowconsf @samnewman
  4. 4. Focused around a business domain Customer Service Technology Agnostic API Accounts Returns Invoicing Shipping Inventory @flowconsf @samnewman
  5. 5. Focused around a business domain Customer Service Technology Agnostic API Small Accounts Returns Invoicing Shipping Inventory @flowconsf @samnewman
  6. 6. Independently Releasable @flowconsf @samnewman
  7. 7. Testing Deployment @flowconsf @samnewman
  8. 8. Service Host @flowconsf @samnewman
  9. 9. Service Host Service Service Service Service Host VS @flowconsf @samnewman
  10. 10. Service Host Service Service Service Service Host VS Much Easier To Reason About @flowconsf @samnewman
  11. 11. Service Host Service Service Service Service Host VS Much Easier To Reason About Easier To Provision @flowconsf @samnewman
  12. 12. Service Host Service Service Service Service Host VS Much Easier To Reason About Easier To Provision Fewer Side-effects @flowconsf @samnewman
  13. 13. Service Host Service Service Service Service Host VS Much Easier To Reason About Easier To Provision Fewer Side-effects Enforces Interdependence @flowconsf @samnewman
  14. 14. Service Host Service Service Service Service Host VS Much Easier To Reason About Easier To Provision Fewer Side-effects Lower host-management overhead Enforces Interdependence @flowconsf @samnewman
  15. 15. Service Host Service Service Service Service Host VS Much Easier To Reason About Easier To Provision Fewer Side-effects Lower host-management overhead Cheaper! Enforces Interdependence @flowconsf @samnewman
  16. 16. Reducing Host Management Overhead? @flowconsf @samnewman
  17. 17. API-driven Host Provisioning @flowconsf @samnewman
  18. 18. Virtualisation Platforms @flowconsf @samnewman
  19. 19. VMWare Virtualisation Platforms @flowconsf @samnewman
  20. 20. VMWare AWS Digital Ocean Virtualisation Platforms @flowconsf @samnewman
  21. 21. Step 0: Provision Host @flowconsf @samnewman
  22. 22. Step 0: Provision Host Step 1: Configure Host @flowconsf @samnewman
  23. 23. Step 0: Provision Host Step 1: Configure Host Step 2: Install Service @flowconsf @samnewman
  24. 24. Step 0: Provision Host Step 1: Configure Host Step 2: Install Service @flowconsf @samnewman
  25. 25. @flowconsf @samnewman
  26. 26. Ansible Puppet Chef @flowconsf @samnewman
  27. 27. Ansible Puppet Chef @flowconsf @samnewman
  28. 28. Ansible Puppet Chef AWS Digital Ocean OpenStack VMWare @flowconsf @samnewman
  29. 29. Ansible Puppet Chef AWS Digital Ocean OpenStack VMWare Vagrant @flowconsf @samnewman
  30. 30. Immutable Servers Ansible Puppet Chef AWS Digital Ocean OpenStack VMWare Vagrant @flowconsf @samnewman
  31. 31. Immutable Servers Fast Spin-up Ansible Puppet Chef AWS Digital Ocean OpenStack VMWare Vagrant @flowconsf @samnewman
  32. 32. Immutable Servers Fast Spin-up Provider Agnostic Ansible Puppet Chef AWS Digital Ocean OpenStack VMWare Vagrant @flowconsf @samnewman
  33. 33. Immutable Servers Fast Spin-up Provider Agnostic Ansible Puppet Chef AWS Digital Ocean OpenStack VMWare Vagrant Feedback Can Suffer @flowconsf @samnewman
  34. 34. Immutable Servers Fast Spin-up Provider Agnostic Ansible Puppet Chef AWS Digital Ocean OpenStack VMWare Vagrant Feedback Can Suffer Cycle Time @flowconsf @samnewman
  35. 35. Immutable Servers @flowconsf @samnewman
  36. 36. Cost? @flowconsf @samnewman
  37. 37. Apps OS VM Hypervisor Base OS Machine Apps OS VM Apps OS VM @flowconsf @samnewman
  38. 38. Apps OS VM Hypervisor Base OS Machine Apps OS VM Apps OS VM Expensive! @flowconsf @samnewman
  39. 39. @flowconsf @samnewman
  40. 40. @flowconsf @samnewman
  41. 41. DOCKER @flowconsf @samnewman
  42. 42. DOCKER Machine @flowconsf @samnewman
  43. 43. DOCKER Base OS Machine @flowconsf @samnewman
  44. 44. DOCKER Docker Base OS Machine @flowconsf @samnewman
  45. 45. DOCKER Docker Base OS Machine Apps @flowconsf @samnewman
  46. 46. DOCKER Apps Apps Docker Base OS Machine @flowconsf @samnewman
  47. 47. DOCKER Apps Apps Apps Docker Base OS Machine @flowconsf @samnewman
  48. 48. DOCKER Apps Apps Apps Docker Base OS Machine Docker Image Registry @flowconsf @samnewman
  49. 49. DOCKER Apps Apps Apps Docker Base OS Machine Docker Image Registry @flowconsf @samnewman
  50. 50. DOCKER Apps Apps Apps Docker Base OS Machine Docker Image Registry @flowconsf @samnewman
  51. 51. @flowconsf @samnewman
  52. 52. @flowconsf @samnewman
  53. 53. Semi-permanent Servers @flowconsf @samnewman
  54. 54. Semi-permanent Servers Image-based Deployments @flowconsf @samnewman
  55. 55. Semi-permanent Servers Image-based Deployments Docker @flowconsf @samnewman
  56. 56. Testing @flowconsf @samnewman
  57. 57. The Monolith DB @flowconsf @samnewman
  58. 58. The Monolith DB @flowconsf @samnewman
  59. 59. The Monolith DB @flowconsf @samnewman
  60. 60. The Monolith DB @flowconsf @samnewman
  61. 61. Shipping Inventory Customer Service Accounts Returns Invoicing @flowconsf @samnewman
  62. 62. Customer Service Accounts Returns Invoicing Shipping Inventory @flowconsf @samnewman
  63. 63. Customer Service Accounts Returns Invoicing Shipping Inventory @flowconsf @samnewman
  64. 64. Inventory Accounts Mountebank http://www.mbtest.org @flowconsf @samnewman
  65. 65. Inventory Accounts! Stub Mountebank http://www.mbtest.org @flowconsf @samnewman
  66. 66. Shipping Inventory Customer Service Accounts Returns Invoicing @flowconsf @samnewman
  67. 67. Shipping Inventory Customer Service Accounts Returns Invoicing @flowconsf @samnewman
  68. 68. Shipping Inventory Customer Service Accounts Returns Invoicing @flowconsf @samnewman
  69. 69. Shipping Inventory Customer Service Accounts Returns Invoicing @flowconsf @samnewman
  70. 70. Shipping Inventory Customer Service Accounts Returns Invoicing @flowconsf @samnewman
  71. 71. @flowconsf @samnewman
  72. 72. Browsers @flowconsf @samnewman
  73. 73. Timing Browsers @flowconsf @samnewman
  74. 74. Provisioning of Environments Timing Browsers @flowconsf @samnewman
  75. 75. Networks Provisioning of Environments Timing Browsers @flowconsf @samnewman
  76. 76. Deployment Networks Provisioning of Environments Timing Browsers @flowconsf @samnewman
  77. 77. Deployment Networks Provisioning of Environments Timing Browsers Diagnosis @flowconsf @samnewman
  78. 78. CONSUMER-DRIVEN CONTRACTS Shipping Inventory @flowconsf @samnewman
  79. 79. CONSUMER-DRIVEN CONTRACTS Shipping Inventory Expectations @flowconsf @samnewman
  80. 80. CONSUMER-DRIVEN CONTRACTS Shipping Inventory Expectations @flowconsf @samnewman
  81. 81. CONSUMER-DRIVEN CONTRACTS Shipping Inventory Expectations Prod @flowconsf @samnewman
  82. 82. CONSUMER-DRIVEN CONTRACTS Shipping Inventory Expectations Prod @flowconsf @samnewman
  83. 83. @flowconsf @samnewman
  84. 84. https://github.com/realestate-com-au/pact @flowconsf @samnewman
  85. 85. No Integration Tests? @flowconsf @samnewman
  86. 86. Journeys @flowconsf @samnewman
  87. 87. Testing @flowconsf @samnewman
  88. 88. Testing Build S/M Tests Large Tests @flowconsf @samnewman
  89. 89. Testing Build S/M Tests Large Tests @flowconsf @samnewman
  90. 90. Testing Build S/M Tests Large Tests Production @flowconsf @samnewman
  91. 91. Testing Monitoring & Alerting Build S/M Tests Large Tests Production @flowconsf @samnewman
  92. 92. Testing Monitoring & Alerting Build S/M Tests Large Tests Production Testers @flowconsf @samnewman
  93. 93. Testing Monitoring & Alerting Build S/M Tests Large Tests Production Testers Operations @flowconsf @samnewman
  94. 94. Monitoring & Alerting Testing @flowconsf @samnewman
  95. 95. Prod Prod Prod Prod @flowconsf @samnewman
  96. 96. Prod Prod Prod Prod QA @flowconsf @samnewman
  97. 97. Monitoring & Alerting Testing @flowconsf @samnewman
  98. 98. Monitoring & Alerting Testing @flowconsf @samnewman
  99. 99. Monitoring & Alerting Testing @flowconsf @samnewman
  100. 100. Monitoring & Alerting Testing @flowconsf @samnewman
  101. 101. @flowconsf @samnewman
  102. 102. @flowconsf @samnewman
  103. 103. SEMANTIC MONITORING @flowconsf @samnewman
  104. 104. @flowconsf @samnewman https://www.flickr.com/photos/robdray/3138644233
  105. 105. Deployment Testing @flowconsf @samnewman
  106. 106. Deployment Testing One-server per host @flowconsf @samnewman
  107. 107. Deployment Image/docker based artefacts Testing One-server per host @flowconsf @samnewman
  108. 108. Deployment One-server per host Immutable Servers Image/docker based artefacts Testing @flowconsf @samnewman
  109. 109. Deployment One-server per host Immutable Servers Image/docker based artefacts Testing Pre-Release Validation Single-server Tests Journey Tests Consumer-driven Contracts @flowconsf @samnewman
  110. 110. Deployment One-server per host Immutable Servers Image/docker based artefacts Testing Post-Release Validation Semantic Monitoring Pre-Release Validation Single-server Tests Journey Tests Consumer-driven Contracts @flowconsf @samnewman
  111. 111. 37 Building Microservices DESIGNING FINE-GRAINED SYSTEMS Sam Newman
  112. 112. THANKS! Any questions: @samnewman snewman@thoughtworks.com

×