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.

LJC Mashup "Building Java Microservices for the Cloud && Chuck Norris Doesn't Need DevOps"

  • Login to see the comments

LJC Mashup "Building Java Microservices for the Cloud && Chuck Norris Doesn't Need DevOps"

  1. 1. Building Java (micro)services for the Cloud The DHARMA principles && Chuck Norris Doesn’t Need DevOps… but Java Developers might benefit Daniel Bryant Principal Consultant, Open Credo daniel.bryant@opencredo.com @danielbryantuk
  2. 2. Who Am I? • Principal Consultant at OpenCredo • LJC Associate  Agile transformations  DevOps, Cloud and Microservices  Big Data • Adopt OpenJDK and JSR 10/11/2014 @danielbryantuk
  3. 3. The Current Industry Wish List… • Service-Oriented Architecture • Cloud-based deployments • DevOps Culture 10/11/2014 @danielbryantuk
  4. 4. The Current Industry Wish List… • Service-Oriented Architecture – muCon 2014 (coming soon via skillsmatter.com) • Cloud-based deployments – JavaOne 2014 (coming soon via parleys.com) • DevOps Culture – Devoxx UK talk (bit.ly/1BylnZb) – Previous LJC Event (bit.ly/1elVPJz) 10/11/2014 @danielbryantuk
  5. 5. So, what’s all this I hear about small services?… 10/11/2014 @danielbryantuk
  6. 6. “Microservices”aka • “SOA done right” • “SRP” services – “Java, The Unix Way” (bit.ly/1cX8VsS) • “Small” codebase services – 1000 LOC… 100… 10…? • “12 Factor apps” (12factor.net) • My personal opinion… 10/11/2014 @danielbryantuk
  7. 7. “Can I fit the service in my head?” 10/11/2014 @danielbryantuk
  8. 8. Moving to the Cloud – common problems… 10/11/2014 @danielbryantuk
  9. 9. Not respecting the underlying environment 10/11/2014 @danielbryantuk
  10. 10. Lack of application/platform monitoring… 10/11/2014 @danielbryantuk
  11. 11. Bizarre failure modes… 10/11/2014 @danielbryantuk
  12. 12. Difficulty in understanding the new architecture 10/11/2014 @danielbryantuk
  13. 13. Not testing in the Cloud… (hint: here be dragons!) 10/11/2014 @danielbryantuk
  14. 14. We’ve created the “Cloud DHARMA Principles” to act as a checklist when building Cloud apps 10/11/2014 @danielbryantuk
  15. 15. Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 10/11/2014 @danielbryantuk
  16. 16. Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 10/11/2014 @danielbryantuk
  17. 17. API Docs with Swagger 10/11/2014 @danielbryantuk helloreverb.com/developers/swagger
  18. 18. Create a PACT 10/11/2014 @danielbryantuk github.com/DiUS/pact-jvm
  19. 19. Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 10/11/2014 @danielbryantuk
  20. 20. High Cohesion / Loose Coupling (all the way down…) • Code • Architecture – Components – Services • Public API – PayPal (bit.ly/1hnZNly) 10/11/2014 @danielbryantuk
  21. 21. Microservices: Architectural Silver Bullet? • Enforce service boundaries – Bounded contexts – Domain-Driven Design • Separation of Concerns – Encapsulate what varies – Easier to scale/tune independently • Is this a free-lunch? (bit.ly/1gSw4L7) 10/11/2014 @danielbryantuk
  22. 22. No!! It’s all too easy to… 1) Create a distributed monolith 2) Push complexity into orchestration www.codingthearchitecture.com/2014/07/06/distributed_big_balls_of_mud.html 10/11/2014 @danielbryantuk
  23. 23. 10/11/2014 @danielbryantuk
  24. 24. Sneak-peak: Smashing the Monolith… • Business functionality -“Cart Service” – Noun, verb, SRP (slidesha.re/1owdJhh) • Technology chunk - “Email Service” • Vertical Slice - “Service per page” – Groupon (vimeo.com/105880150) • Horizontal Slice - “User Repo” – An anti-pattern? 10/11/2014 @danielbryantuk
  25. 25. DZone’s Enterprise Integration Guide 10/11/2014 @danielbryantuk www.dzone.com/page/research
  26. 26. Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 10/11/2014 @danielbryantuk
  27. 27. Thou Shalt Know thy Cloud… “Everything fails all the time [in the cloud]” Werner Vogels, CTO, Amazon.com • Everything is ephemeral • Volatility • Noisy (virtual) neighbours – bit.ly/1w1HQy7 10/11/2014 @danielbryantuk
  28. 28. Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 10/11/2014 @danielbryantuk
  29. 29. Antifragile • The opposite of fragile? – Robust… – Antifragile… • Netflix are best-in-class – bit.ly/1gs5n3q • System must be robust first! 10/11/2014 @danielbryantuk
  30. 30. Design for Failure • Distributed Computing Principles – ‘For young bloods’ (bit.ly/1pKVepz) – Eight Fallacies… (bit.ly/1zCBet7) • Design patterns – Timeouts / retries – Bulkheads / circuit-breakers 10/11/2014 @danielbryantuk
  31. 31. Retries 10/11/2014 @danielbryantuk github.com/rholder/guava-retrying
  32. 32. Circuit-breaker/bulkhead 10/11/2014 @danielbryantuk github.com/Netflix/Hystrix projects.spring.io/spring-cloud/
  33. 33. Antifragile Patterns: Elastic Scaling Stateless components Distributed data stores / caches 10/11/2014 @danielbryantuk
  34. 34. Microservices in the Cloud… Documented (just enough) Highly cohesive/loosely coupled (all the way down) Automated from commit to Cloud Resource aware Monitored thoroughly Antifragile 10/11/2014 @danielbryantuk
  35. 35. and now to DevOps… …or as the recruiters like to say “DeeVoips”, “DevAnOps” and “Dev-Oops” 10/11/2014 @danielbryantuk
  36. 36. What’s in a Name? • “Development / Operations” • Increasing cohesion between: – Business – Development – Quality Assurance – Operations “Bu-Dev-Qa-Ops”? 10/11/2014 @danielbryantuk
  37. 37. So, What’s Chuck Norris Doing Here? 10/11/2014 @danielbryantuk
  38. 38. Chuck Norris doesn’t need DevOps… …as a one-man army he codes with one hand, tests with the other and deploys with his beard The rest of us… …work in teams to develop software 10/11/2014 @danielbryantuk
  39. 39. Software Development Teams • Developers • Quality Assurance • Operations 10/11/2014 @danielbryantuk
  40. 40. Software Development Teams • Developers • Quality Assurance • Operations 10/11/2014 @danielbryantuk
  41. 41. 10/11/2014 @danielbryantuk
  42. 42. Software Development Teams • Developers • Quality Assurance • Operations 10/11/2014 @danielbryantuk
  43. 43. 10/11/2014 @danielbryantuk
  44. 44. Software Development Teams • Developers • Quality Assurance • Operations 10/11/2014 @danielbryantuk
  45. 45. 10/11/2014 @danielbryantuk
  46. 46. This silo mentality has to stop 10/11/2014 @danielbryantuk
  47. 47. Culture is Vital • Culture drives behaviour, drives culture… – “Communication, simplicity, feedback, courage” – Everyone is responsible for delivery – Continuous experimentation and learning • Not easy to change culture – The hardest part of DevOps… – …but you will learn new things 10/11/2014 @danielbryantuk
  48. 48. Changing Culture • Create an effective team… • “Habits of highly effective technical teams” – Martijn Verburg (bit.ly/1aF9SnK) • “Patterns of Effective Teams” – Dan North (vimeo.com/68226771) 10/11/2014 @danielbryantuk
  49. 49. Chuck Norris doesn’t do QA… …Chuck Norris can test an entire application with a single assert (and get 110% code coverage) The rest of us… …need high-quality automated QA 10/11/2014 @danielbryantuk
  50. 50. Automating QA • Intra-component integration testing – Utilise embedded datastore/middleware – Cucumber (via ports/adapters/API?) • Fault-tolerance – Chris Batey’s Skillscast (bit.ly/1tU6wZj) – WireMock + Saboteur (wiremock.org) – “Scassandra” (github.com/scassandra) 10/11/2014 @danielbryantuk
  51. 51. Automating QA • Inter-component integration testing – The hardest part of SOA… – Consider ‘synthetic txns’ (active monitoring) • Service virtualisation – Mountebank (www.mbtest.org) – Mock external services (e.g. Spring profiles) 10/11/2014 @danielbryantuk
  52. 52. All arrays Chuck Norris creates are of infinite size… …as Chuck Norris knows no bounds The rest of us… …should manage our resources and cultivate ‘mechanical sympathy’ 10/11/2014 @danielbryantuk
  53. 53. Cultivating “Mechanical Sympathy” • Virtualisation – Tech Target (bit.ly/1kDVqyG) • Networking – ‘Unix and Linux System Administration Handbook’ – AWS docs aws.amazon.com/documentation • Thinking/Acting Operationally – You write it, you run it… (“dev on call”) 10/11/2014 @danielbryantuk
  54. 54. When Chuck Norris throws Exceptions… …everybody knows about it because they land outside of the data center The rest of us… …should log all errors (and other vital information for diagnostic purposes) 10/11/2014 @danielbryantuk
  55. 55. Monitor All The Things! • Infrastructure monitoring – Nagios / Zabbix – Codahale, Actuator • Distributed Tracing – twitter.github.io/zipkin • Centralised Logging – logstash.net 10/11/2014 @danielbryantuk
  56. 56. The ‘ELK’ Stack blog.comperiosearch.com/blog/2014/08/14/elk-one-vagrant-box 10/11/2014 @danielbryantuk
  57. 57. “…but what should I graph?” 10/11/2014 @danielbryantuk
  58. 58. 10/11/2014 @danielbryantuk Phrase borrowed from Etsy!
  59. 59. 10/11/2014 @danielbryantuk
  60. 60. Thanks For Listening • Massive thanks – OpenCredo (@OpenCredo) – notonthehighstreet.com – RecWorks & The LJC • Questions / comments? – daniel.bryant@opencredo.com – @danielbryantuk 10/11/2014 @danielbryantuk

×