Slide 1

Slide 1 text

Microservices Architecture: The Blind Spots Irakli Nadareishvili, Director of Strategy, API Academy CA Technologies Deck: http://bit.ly/microservices-blindspots

Slide 2

Slide 2 text

2 © 2015 CA. ALL RIGHTS RESERVED. inadarei

Slide 3

Slide 3 text

3 © 2015 CA. ALL RIGHTS RESERVED. inadarei #1 What Drives Microservices Adoption? ¯\_(ツ)_/¯

Slide 4

Slide 4 text

4 © 2015 CA. ALL RIGHTS RESERVED. inadarei

Slide 5

Slide 5 text

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)

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

7 © 2015 CA. ALL RIGHTS RESERVED. inadarei Docker is a "gateway drug" for MSA

Slide 8

Slide 8 text

8 © 2015 CA. ALL RIGHTS RESERVED. inadarei Containerization will drive MSA Adoption to the extent that: Microserviceswon't be a "choice" Prediction:

Slide 9

Slide 9 text

9 © 2015 CA. ALL RIGHTS RESERVED. inadarei #2 Current Focus Is Too Code-Centric

Slide 10

Slide 10 text

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.

Slide 11

Slide 11 text

11 © 2015 CA. ALL RIGHTS RESERVED. inadarei #3 Decentralized Data

Slide 12

Slide 12 text

12 © 2015 CA. ALL RIGHTS RESERVED. inadarei

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

15 © 2015 CA. ALL RIGHTS RESERVED. inadarei

Slide 16

Slide 16 text

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.

Slide 17

Slide 17 text

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.

Slide 18

Slide 18 text

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.

Slide 19

Slide 19 text

19 © 2015 CA. ALL RIGHTS RESERVED. inadarei Data Storage Alternative: Event Sourcing & CQRS

Slide 20

Slide 20 text

20 © 2015 CA. ALL RIGHTS RESERVED. inadarei CRUD-Oriented System Model Patient Demographics Clinical Notes (3) Billing Information Insurances (2) Visits (3)

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

23 © 2015 CA. ALL RIGHTS RESERVED. inadarei "Current State"-Oriented System Model Patient Demographics Clinical Notes (3) Billing Information Insurances (2) Visits (3)

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

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.

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

28 © 2015 CA. ALL RIGHTS RESERVED. inadarei One More Thing…

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

30 © 2015 CA. ALL RIGHTS RESERVED. inadarei https://github.com/apiacademy /microservices-deployment

Slide 31

Slide 31 text

Director of Strategy, API Academy Irakli Nadareishvili @inadarei @apiacademy @cainc http://bit.ly/microservices-blindspots