microservices architecture - the blind spots

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

Upload: irakli-nadareishvili

Post on 16-Jan-2017

360 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Microservices Architecture - The Blind Spots

Microservices Architecture:The Blind Spots

Irakli Nadareishvili,

Director of Strategy, API Academy

CA Technologies

Deck:http://bit.ly/microservices-blindspots

Page 2: Microservices Architecture - The Blind Spots

2 ©2015CA.ALLRIGHTSRESERVED. inadarei

Page 3: Microservices Architecture - The Blind Spots

3 ©2015CA.ALLRIGHTSRESERVED. inadarei

#1What Drives Microservices Adoption?

¯\_(ツ)_/¯

Page 4: Microservices Architecture - The Blind Spots

4 ©2015CA.ALLRIGHTSRESERVED. inadarei

Page 5: Microservices Architecture - The Blind Spots

5 ©2015CA.ALLRIGHTSRESERVED. inadarei

TechnologyHeterogeneityPartitionedScalability(permicroservice)IndependentDeploymentsCompose-abilityOptimizedforReplace-ability

1

2

3

4

5

Key Benefits of Microservices (as of 2015)

Page 6: Microservices Architecture - The Blind Spots

6 ©2015CA.ALLRIGHTSRESERVED. inadarei

Motivations for Adoption Will ChangeThereasonswhyMSAbecamepopulararenotthesamereasonswhyitwillbecomeubiquitous

Page 7: Microservices Architecture - The Blind Spots

7 ©2015CA.ALLRIGHTSRESERVED. inadarei

Docker is a "gateway drug" for MSA

Page 8: Microservices Architecture - The Blind Spots

8 ©2015CA.ALLRIGHTSRESERVED. inadarei

Containerization will drive MSA Adoptionto the extent that:

Microservices won't be a "choice"

Prediction:

Page 9: Microservices Architecture - The Blind Spots

9 ©2015CA.ALLRIGHTSRESERVED. inadarei

#2Current Focus Is Too Code-Centric

Page 10: Microservices Architecture - The Blind Spots

10 ©2015CA.ALLRIGHTSRESERVED. 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.

Page 11: Microservices Architecture - The Blind Spots

11 ©2015CA.ALLRIGHTSRESERVED. inadarei

#3Decentralized Data

Page 12: Microservices Architecture - The Blind Spots

12 ©2015CA.ALLRIGHTSRESERVED. inadarei

Page 13: Microservices Architecture - The Blind Spots

13 ©2015CA.ALLRIGHTSRESERVED. inadarei

DDD & Bounded Contexts

Page 14: Microservices Architecture - The Blind Spots

14 ©2015CA.ALLRIGHTSRESERVED. 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

Page 15: Microservices Architecture - The Blind Spots

15 ©2015CA.ALLRIGHTSRESERVED. inadarei

Page 16: Microservices Architecture - The Blind Spots

16 ©2015CA.ALLRIGHTSRESERVED. inadarei

“Bounded context should be asbig as it needs to be in order tofully express its completeUbiquitous Language”

– Vaughn Vernon, Implementing Domain –Driven Design.

Page 17: Microservices Architecture - The Blind Spots

17 ©2015CA.ALLRIGHTSRESERVED. inadarei

Inherent Conflict:Business teamsactuallydon'tfavorsmallboundedcontexts(duetodiff.ubiquitouslanguage).

Fortech:continuousIntegrationiseasierwithsmallerteamsandcodebases.

Page 18: Microservices Architecture - The Blind Spots

18 ©2015CA.ALLRIGHTSRESERVED. inadarei

In general: DDD alone will not be able to give you small enough microservices and/or solve data embedding requirements.

Page 19: Microservices Architecture - The Blind Spots

19 ©2015CA.ALLRIGHTSRESERVED. inadarei

Data Storage Alternative: Event Sourcing & CQRS

Page 20: Microservices Architecture - The Blind Spots

20 ©2015CA.ALLRIGHTSRESERVED. inadarei

"Current State"-Oriented System Model

PatientDemographics

ClinicalNotes(3)

BillingInformation

Insurances(2)

Visits(3)

Page 21: Microservices Architecture - The Blind Spots

21 ©2015CA.ALLRIGHTSRESERVED. inadarei

Event SourcingUse an append-only store to record the full series of events that describe actions taken on data in a domain, rather than storing just the current state, so that the store can be used to materialize the domain objects.

https://msdn.microsoft.com/en-gb/library/dn589792.aspx

Page 22: Microservices Architecture - The Blind Spots

22 ©2015CA.ALLRIGHTSRESERVED. 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

Page 23: Microservices Architecture - The Blind Spots

23 ©2015CA.ALLRIGHTSRESERVED. inadarei

Events-based Model

PatientCreated

InsuranceAdded

InsuranceAdded

BillingInfoAdded

Visit'sClinicalNoteAdded

Visit'sClinicalNoteAdded

Visit'sClinicalNoteAdded

Visit'sClinicalNoteAdded

Visit'sClinicalNoteAdded

Visit'sClinicalNoteAdded

Visit'sClinicalNoteAdded

VisitAdded

VisitAdded

VisitAdded

Page 24: Microservices Architecture - The Blind Spots

24 ©2015CA.ALLRIGHTSRESERVED. 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

Page 25: Microservices Architecture - The Blind Spots

25 ©2015CA.ALLRIGHTSRESERVED. inadarei

"Patient Visits" Microservice

VisitMessageQueue

EventStore(e.g.Cassandra)

"List Patient Visits by a Doctor" Microservice

Query IndexStore(e.g.ElasticSearch)

Validation

Page 26: Microservices Architecture - The Blind Spots

26 ©2015CA.ALLRIGHTSRESERVED. inadarei

What About Them Transactions?

Use: Sagas (Long-LivedDistributedTransactions)

@see:http://vasters.com/clemensv/2012/09/01/Sagas.aspx

Designedby:HectorGarcia-Molina&KennethSalem,Princeton,1987

Page 27: Microservices Architecture - The Blind Spots

27 ©2015CA.ALLRIGHTSRESERVED. inadarei

One More Thing…

Page 28: Microservices Architecture - The Blind Spots

28 ©2015CA.ALLRIGHTSRESERVED. inadarei

http://martinfowler.com/bliki/MicroservicePrerequisites.html

I really, really hated this message, so I did smth. about it

Page 29: Microservices Architecture - The Blind Spots

29 ©2015CA.ALLRIGHTSRESERVED. inadarei

https://github.com/apiacademy/microservices-deployment

Page 30: Microservices Architecture - The Blind Spots

DirectorofStrategy,APIAcademyIrakliNadareishvili

@inadarei

@apiacademy

@cainc

http://bit.ly/microservices-blindspots