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.

Simple, battle proven microservices strategy

334 views

Published on

http://summit2016.reversim.com
This is not yet another technology list, buzzword packed, look-how-good-we-are show off. Actually it is technology/language agnostic and I won't to say Docker even once ;)
The newcomer into this world is overwhelmed with information, patterns, tools and practices. Having delivered numerous such projects, I'll try to separate the wheat from the chaff.
This is a clear recipe for the key practices you should keep when building continuously delivered microservice.

Video recording (Hebrew) available at https://youtu.be/Rc1K1CXjb7s

Published in: Software
  • Be the first to comment

  • Be the first to like this

Simple, battle proven microservices strategy

  1. 1. Simple, Battle Proven Microservices Strategy
  2. 2. About me Chief Architect @ Kenshoo Java backend since 2004 Microservices + CD since 2008
  3. 3. Agenda Quick intro to MSA Scope Speed Stability Stuff we learned
  4. 4. About microservices developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms … independently deployable by fully automated deployment machinery. … each service also provides a firm module boundary, even allowing for different services to be written in different programming languages. They can also be managed by different teams … ...decomposed into multiple services, you can expect many single service changes to only require that service to be redeployed. James Lewis, Martin Fowler - Microservices a definition of this new architectural term
  5. 5. About microservices developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms … independently deployable by fully automated deployment machinery. … each service also provides a firm module boundary, even allowing for different services to be written in different programming languages. They can also be managed by different teams … ...decomposed into multiple services, you can expect many single service changes to only require that service to be redeployed.
  6. 6. High FocusPhoto by Philippe Henry, available under a Creative Commons Attribution-Noncommercial license. Limited Scope
  7. 7. Independant Photo by PEXELS, available under a CC0 license. Simple
  8. 8. Scope Define Firm Boundary
  9. 9. API ➔ Create a buffer layer for isolation. ➔ Also useful for caching, monitoring, error handling, mocking, etc` ConsumeMy Special Service Used by me Using me Produce
  10. 10. API ➔ Less is more ➔ Consume only what you need. ➔ Publish only what you are willing to commit to
  11. 11. I DON’T ALWAYS BUILD MICROSERVICES BUT WHEN I DO I NEVER USE CLIENT LIBRARIES
  12. 12. Speed Maintain fast pace over time
  13. 13. S = A (D + T)
  14. 14. Speed = Automation (Deployment + Tests) S = A (D + T)
  15. 15. Reliable Testing Unit Component Integration Smoke My Special Service Some other service
  16. 16. Some other service Unit Tests Unit Component Integration Smoke My Special Service
  17. 17. Component Tests Unit Component Integration Smoke My Special Service Some other service
  18. 18. Integration Tests Unit Component Integration Smoke My Special Service Some other service
  19. 19. Smoke Tests Unit Component Integration Smoke My Special Service Some other service
  20. 20. Photo by William Warby
  21. 21. NO We’re not doing it enough
  22. 22. Hello Prod CI/CD for dummies in 5 simple steps
  23. 23. Where Local dev machine. What Unit, Component & Integration tests. When Before commit and as much as possible Artifact Easy checkout, change, and run Local build Centralized Build Artifact Bake Automated Staging Production
  24. 24. Local build Centralized Build Artifact Bake Automated Staging Production Where CI Server, Feature branch What Unit, Component & Integration tests. When Each commit (PR) Artifact “Mergability”
  25. 25. Local build Centralized Build Artifact Bake Automated Staging Production Where CI Server, Master branch What Unit, Component & Integration tests. When Each commit (Pull Request merge) Artifact Next Production (Immutable Infrastructure).
  26. 26. Local build Centralized Build Artifact Bake Automated Staging Production Where CD Server, Dedicated testing env What Deploy next production, execute Smoke Test When Whenever a new artifact is baked Artifact Confidence in next production
  27. 27. Local build Centralized Build Artifact Bake Automated Staging Production Where CD Server, Production What Green-Blue / Canary Execute relevant checks. When After a baked artifact is verified in staging
  28. 28. Stability
  29. 29. Speed is Queen Backward Compatibility is King Photo by michael iCruz, available under a Creative Commons Attribution-Noncommercial license.
  30. 30. Backward Compatibility Don’t ➔ Couple deployment of multiple services ➔ Big bang migrations, especially with down time Photo by Pierre J., available under a CC Attribution-Noncommercial-ShareAlike 2.0 Generic license.
  31. 31. Backward Compatibility Do ➔ Many small changes through multiple services ➔ Decouple data migration from logic change
  32. 32. Backward Compatibility API Data Logic ● Use ‘Data Only’ protocol (Json, protobuf, etc’) ● Serialization tests
  33. 33. Backward Compatibility API Data Logic ● Load and Save test - Keep old data records for tests. ● Refresh staging data from production. ○ Can be part of a ‘Smoke Test’
  34. 34. Backward Compatibility API Data Logic ● What counts for broken compatibility logic? ● Changing / removing Component tests is a red signal. ● Prefer degraded service over broken service
  35. 35. Expect Failure ➔ External Service ◆ Circuit Breaker ◆ Best Effort? ◆ Persistent Retry
  36. 36. Stuff we learned at Kenshoo
  37. 37. Remember the episode I waited for someone to fix my servers? Yeah,... me neither
  38. 38. Who’s looking at the big picture?
  39. 39. Who’s looking at the big picture?
  40. 40. Melvin E. Conway Any organization that designs a system … will produce a design whose structure is a copy of the organization's communication structure
  41. 41. Melvin E. Conway Inverse Conway maneuver
  42. 42. Q&A
  43. 43. Thank You

×