Microservices Architecture: The Blind Spots by Irakli Nadareishvili

Microservices Architecture: The Blind Spots by Irakli Nadareishvili

Transcript

  1. Microservices Architecture: The Blind Spots Irakli Nadareishvili, Director of Strategy,

    API Academy CA Technologies Deck: http://bit.ly/microservices-blindspots
  2. 2 © 2015 CA. ALL RIGHTS RESERVED. inadarei

  3. 3 © 2015 CA. ALL RIGHTS RESERVED. inadarei #1 What

    Drives Microservices Adoption? ¯\_(ツ)_/¯
  4. 4 © 2015 CA. ALL RIGHTS RESERVED. inadarei

  5. 5 © 2015 CA. ALL RIGHTS RESERVED. inadarei Technology Heterogeneity

    Partitioned Scalability (per microservice) Independent Deployments Compose-ability Optimized for Replace-ability 1 2 3 4 5 Key Benefits of Microservices(as of 2015)
  6. 6 © 2015 CA. ALL RIGHTS RESERVED. inadarei Motivations for

    Adoption Will Change The reasons why MSA became popular are not the same reasons why it will become ubiquitous Source: Crossing the Chasm – Geoffrey A. Moore
  7. 7 © 2015 CA. ALL RIGHTS RESERVED. inadarei Docker is

    a "gateway drug" for MSA
  8. 8 © 2015 CA. ALL RIGHTS RESERVED. inadarei Containerization will

    drive MSA Adoption to the extent that: Microserviceswon't be a "choice" Prediction:
  9. 9 © 2015 CA. ALL RIGHTS RESERVED. inadarei #2 Current

    Focus Is Too Code-Centric
  10. 10 © 2015 CA. ALL RIGHTS RESERVED. inadarei Caution: Coupling

    of service interfaces is every bit as toxic as the code one, and can render entire architecture useless. Hypermedia design, with its high degree of interface de-coupling can be of huge help here.
  11. 11 © 2015 CA. ALL RIGHTS RESERVED. inadarei #3 Decentralized

    Data
  12. 12 © 2015 CA. ALL RIGHTS RESERVED. inadarei

  13. 13 © 2015 CA. ALL RIGHTS RESERVED. inadarei DDD &

    Bounded Contexts
  14. 14 © 2015 CA. ALL RIGHTS RESERVED. inadarei Bounded Context

    = Capabilities. “In your organization, you should be thinking not in terms of data that is shared, but about the capabilities those contexts provide the rest of the domain.” – Sam Newman, Building Microservices
  15. 15 © 2015 CA. ALL RIGHTS RESERVED. inadarei

  16. 16 © 2015 CA. ALL RIGHTS RESERVED. inadarei “Bounded context

    should be as big as it needs to be in order to fully express its complete Ubiquitous Language” – Vaughn Vernon, Implementing Domain –Driven Design.
  17. 17 © 2015 CA. ALL RIGHTS RESERVED. inadarei Inherent Conflict:

    Business teams actually don't favor small bounded contexts (due to diff. ubiquitous language). For tech: continuous Integration is easier with smaller teams and codebases.
  18. 18 © 2015 CA. ALL RIGHTS RESERVED. inadarei In general:

    DDD alone will not be able to give you small enough microservices and/or solve data embedding requirements.
  19. 19 © 2015 CA. ALL RIGHTS RESERVED. inadarei Data Storage

    Alternative: Event Sourcing & CQRS
  20. 20 © 2015 CA. ALL RIGHTS RESERVED. inadarei CRUD-Oriented System

    Model Patient Demographics Clinical Notes (3) Billing Information Insurances (2) Visits (3)
  21. 21 © 2015 CA. ALL RIGHTS RESERVED. inadarei "Event Sourcing

    is all about storing facts and any time you have "state" (structural models) – they are first-level derivative off of your facts. And they are transient." - Greg Young
  22. 22 © 2015 CA. ALL RIGHTS RESERVED. inadarei Command and

    Query Responsibility Segregation (CQRS) Segregate operations that read data from operations that update data by using separate interfaces. This pattern can maximize performance, scalability, and security; support evolution of the system over time through higher flexibility; and prevent update commands from causing merge conflicts at the domain level. https://msdn.microsoft.com/en-us/library/dn568103.aspx
  23. 23 © 2015 CA. ALL RIGHTS RESERVED. inadarei "Current State"-Oriented

    System Model Patient Demographics Clinical Notes (3) Billing Information Insurances (2) Visits (3)
  24. 24 © 2015 CA. ALL RIGHTS RESERVED. inadarei Events-based Model

    Patient Created Insurance Added Insurance Added Billing Info Added Visit's Clinical NoteAdded Visit's Clinical NoteAdded Visit's Clinical NoteAdded Visit's Clinical NoteAdded Visit's Clinical NoteAdded Visit's Clinical NoteAdded Visit's Clinical NoteAdded … Visit Added Visit Added Visit Added
  25. 25 © 2015 CA. ALL RIGHTS RESERVED. inadarei "Patient Visits"

    Microservice Visit Message Queue Facts Store (e.g. Cassandra) "List Patient Visits by a Doctor" Microservice Query Index Store (e.g. ElasticSearch) Validation
  26. 26 © 2015 CA. ALL RIGHTS RESERVED. inadarei Do Not

    Overuse ES or CQRS! You should only use Event Sourcing and CQRS when necessary. It is not an architecture for your entire system, but a tool to be used sparingly.
  27. 27 © 2015 CA. ALL RIGHTS RESERVED. inadarei What About

    Them Transactions? Use: Sagas (Long-Lived Distributed Transactions) @see: http://vasters.com/clemensv/2012/09/01/Sagas.aspx Designed by: Hector Garcia-Molina & Kenneth Salem, Princeton, 1987
  28. 28 © 2015 CA. ALL RIGHTS RESERVED. inadarei One More

    Thing…
  29. 29 © 2015 CA. ALL RIGHTS RESERVED. inadarei http://martinfowler.com/bliki/MicroservicePrerequisites.html I

    really, really hated this message, so I did smth. about it
  30. 30 © 2015 CA. ALL RIGHTS RESERVED. inadarei https://github.com/apiacademy /microservices-deployment

  31. Director of Strategy, API Academy Irakli Nadareishvili @inadarei @apiacademy @cainc

    http://bit.ly/microservices-blindspots