Microservices rubyconf-2013

1,501 views

Published on

Published in: Technology, Business
  • @Lucas, saw your comment after 10 months of you posting it :) If you have any other questions tweet at me: @mohitthatte
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • how can you do integration tests when one repo/micro service integrates with other services? We deployed all the services in an integration environment. what service/tool are you using for test automation? Go CD, tests were written in RSpec and Cucumber. looking at most of the cloud testing tools, they limit to one repo at a time and exclude VPN/inbound internet access, making integration tests difficult. Thats an interesting problem - I haven't really used any of the cloud testing tools, so don't have an answer.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • i would like to understand your CI/CD strategy more. how can you do integration tests when one repo/micro service integrates with other services? what service/tool are you using for test automation? looking at most of the cloud testing tools, they limit to one repo at a time and exclude VPN/inbound internet access, making integration tests difficult.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Microservices rubyconf-2013

  1. 1. Adventures with micro-Services Mohit Thatte (@mohitthatte) Anand Agrawal (@anand_agrawal) ThoughtWorks Inc.
  2. 2. Enough about us. What’s in it for you?
  3. 3. What? Why? How? When?
  4. 4. What are micro services?services?micro
  5. 5. What are micro services? services? micro
  6. 6. What are micro services? A real thing that does some thing! services? micro
  7. 7. What are micro services? A real thing that does some thing!Implementation Contract services? micro
  8. 8. What are micro services? small independent composable services that do one thing well
  9. 9. Unix philosophy Write programs that do one thing well. Write programs that work together. cat | grep | sed | awk | ... HTTP is the new pipe!
  10. 10. Single responsibility Low coupling, high cohesion Small, well defined interfaces Object Oriented philosophy
  11. 11. use micro services?Why we
  12. 12. Once upon a time...
  13. 13. lots of legacy, no reuse not flexible, high cost of change no one knows how it works concentrated complexity 90 year old business
  14. 14. lots of legacy, no reuse not flexible, high cost of change no one knows how it works concentrated complexity independent small that do one thingcomposable 90 year old business
  15. 15. “A 100k loc app is just 100 1k loc apps waiting to happen” - Jeff Bay
  16. 16. Adventure so far 25 VM’s in production 10 micro-services one click deployment 60+ VM’s across environments
  17. 17. µService DB µService DB µService DB µService DB
  18. 18. How did we start?
  19. 19. Solve small, valuable problems
  20. 20. Start with high level services
  21. 21. When a service starts doing too much, extract a smaller one
  22. 22. Orders PaymentsCustomers Catalog (Games)
  23. 23. Orders PaymentsCustomers Legacy Catalog (Games)
  24. 24. Orders PaymentsCustomers Legacy Order Processing Catalog (Games)
  25. 25. Orders PaymentsCustomers Legacy Results Order Processing Catalog (Games)
  26. 26. Looks like plain old services, what makes them ‘micro’?
  27. 27. single responsibility 1 service = 1 ‘resource’ (maybe 2!)
  28. 28. I can haz code of conduct?
  29. 29. respect service boundaries focus on contracts avoid coupling extract cross cutting concerns
  30. 30. Orders PaymentsCustomers Communications Legacy Results Order Processing Scheduled Jobs Error reporting Catalog (Games)
  31. 31. So many repos, how do you stay productive?
  32. 32. automate, automate, automate...
  33. 33. DevOps #ftw 15 minute dev box setup spin up a new service in minutes* Vagrant + Puppet = AWESOME!
  34. 34. feature toggles over branches
  35. 35. client gems
  36. 36. Is that all captain?
  37. 37. add health checks + circuit breaker
  38. 38. logging can you trace a request through?
  39. 39. Avoid / Defer versioning services manual tinkering on VM’s
  40. 40. How do I make a change and still stay sane?
  41. 41. Test It!
  42. 42. Unit Tests
  43. 43. Contract Tests is my service doing what it should? out of container strictly black box
  44. 44. Integration Tests are all my services playing nicely together? testing distributed effects testing async actions
  45. 45. Continuous Integration Integration Tests UAT Performance Production Service Tests
  46. 46. Ok, so you tested it, now release it!
  47. 47. Step 1: Set up ze VM’s
  48. 48. Puppet Solo + SSH in a loop Puppet goes through CI just like app code Our ideal : ImmutableServer deploy all or nothing
  49. 49. Step 2: Deploy ze code
  50. 50. Continuous Integration Integration Tests UAT Performance Production Service Tests
  51. 51. CI + DevOps enables single-click deployment so easy, our product owner does it! it just works™ 3 mins to production (~25 servers)
  52. 52. “we’re effectively pushing the complexity from the application into the infrastructure...” - James Lewis
  53. 53. When to use micro-services?
  54. 54. Tradeoffs benefit cost small units of reuse/maintain complex infrastructure grow independently learning curve scale independently network overhead independent DB fragmented data Polyglot
  55. 55. Thanks!
  56. 56. Questions?

×