Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Microservices introduction

Microservices introduction

A quick introduction to microservices, its challenges and advantages.

Boris Feld

July 21, 2015
Tweet

More Decks by Boris Feld

Other Decks in Programming

Transcript

  1. History ❖ Starts in ~2012 / 2013 ❖ A synchronized

    evolution ❖ Helped by cloud evolution ❖ Pioneers: James Lewis from ThoughtWorks and Adrian Cockcroft from Netflix ❖ Advocators like Martin Fowler from ThoughtWorks
  2. Who uses it ❖ Heavy user ❖ Unknown number of

    services ❖ ~100-150 service called/page ❖ Pioneer ❖ Open-Source and blog a lot! ❖ ~800 services ❖ ~6 service called/api call
  3. Challenges ❖ Service discovery ❖ Performance overhead ❖ ACID, availability

    ❖ Links ❖ Asynchronism ❖ Value by service composition ❖ Distributed system
  4. HTTP ❖ Simple ❖ Knowledge of scaling, load-balancing and securing

    ❖ Support for every language ❖ Basic protocol, so REST is often used
  5. Choice ❖ Internal competences ❖ Needs for performance ❖ One

    choice per pattern ❖ Starts with HTTP, use MQ for events ❖ P2P vs centralized
  6. Service discovery ❖ How to find a peer? ❖ How

    to detect new peer or leaving peers?
  7. ACID / Availability ❖ ACID is hard to ensure in

    a distributed system ❖ Occasion to define which service need ACID or not ❖ The number of view might not, the billing yes definitely
  8. Links ❖ No more DB joins ❖ Need to switch

    to applications links ❖ Think about graph ❖ Links are explicitly costly ❖ Play with services boundaries
  9. Asynchronism ❖ With more communication, harder to stay synchronous ❖

    For a query, may require collaboration of severals micro- services ❖ Difficulties with HTTP ❖ Mandatory for event-driven reactions
  10. Value by composition ❖ « dumb-pipe, smart endpoint » ❖

    Some value is made by service composition ❖ Harder to visualize and think about ❖ Need tooling and design upfront
  11. Distributed system ❖ Everything is a distributed system ❖ In

    monolith, easy to forget ❖ Network is not resilient ❖ Design for failure ❖ https://blogs.oracle.com/jag/resource/Fallacies.html
  12. -Conway’s law « organizations which design systems ... are constrained

    to produce designs which are copies of the communication structures of these organizations »
  13. Organisation ❖ Each team should manage the service lifetime from

    value definition to production and maintenance, « you build it, you run it » ❖ Require cross-functional teams ❖ Amazon’s Two Pizza Team (i.e. the whole team can be fed by two pizzas)
  14. Prerequisites ❖ Infrastructure ❖ Deployment, monitoring, reporting, debugging ❖ Feature

    re-splitting or refactoring is hard ❖ New design methods, DDD, bounded contexts
  15. Monolith defenders ❖ Most companies don’t need micro-services ❖ Etsy,

    Facebook architecture are monolith at scale ❖ Focus on internal architecture first
  16. MicroServices & Monolith ❖ How to evolve? ❖ Keep legacy

    monolith ❖ New features as services ❖ Static, safe and legacy core ❖ Update on just one micro-service
  17. Micro-services VS SOA ❖ « dumb-pipe, smart endpoint » ❖

    Micro-Services = SOA + DevOPS ❖ MicroServices done right ❖ Share service orientation
  18. Community ❖ More and more literature ❖ More and more

    open-source projects ❖ Document and explicit traps and challenges.
  19. To continue ❖ API / Rest interface ❖ Container based

    deployment ❖ Good companion of DevOps / Lean / Agile
  20. Conclusion ❖ Micro-services offer new leads to beat entropy ❖

    But it’s not free ❖ Requires discipline and maturity
  21. Litterature ❖ https://www.nginx.com/blog/microservices-at-netflix-architectural-best-practices/ ❖ http://www.occitech.fr/blog/2015/02/les-microservices/ ❖ http://www.infoq.com/fr/news/2015/02/microservices-sharing-code ❖ http://highscalability.com/blog/2014/10/27/microservices-in-production-the-good-the-bad-the-it- works.html

    ❖ http://highscalability.com/blog/2015/4/27/how-can-we-build-better-complex-systems-containers- microserv.html ❖ https://medium.com/s-c-a-l-e/microservices-monoliths-and-laser-nail-guns-how-etsy-finds-the-right- focus-in-a-sea-of-cf718a92dc90 ❖ http://www.jamesward.com/2015/06/08/comparing-application-deployment-2005-vs-2015 ❖ http://martinfowler.com/articles/microservices.html ❖ http://www.touilleur-express.fr/2015/02/25/micro-services-ou-peon-architecture/ ❖ http://daily.captaindash.com/anti-fragile-microservices-love-stress/
  22. Litterature II ❖ http://www.boundary.com/blog/2014/08/microservices-conways-law/ ❖ http://www.thoughtworks.com/insights/blog/microservices-nutshell ❖ https://speakerdeck.com/tastapod/microservices-software-that-fits-in-your-head ❖ http://bravenewgeek.com/from-mainframe-to-microservice-an-introduction-to-

    distributed-systems/ ❖ http://dejanglozic.com/2014/10/20/micro-services-and-page-composition- problem/ ❖ http://fr.slideshare.net/dbryant_uk/devoxxuk-2015-the-seven-deadly-sins-of- microservices-full-version ❖ http://martinfowler.com/articles/microservice-testing/