+ All Categories
Home > Documents > MicroservicesIn Practice - freshblurbs.com · MicroservicesIn Practice Irakli Nadareishvili, ... to...

MicroservicesIn Practice - freshblurbs.com · MicroservicesIn Practice Irakli Nadareishvili, ... to...

Date post: 28-Apr-2018
Category:
Upload: vantu
View: 221 times
Download: 1 times
Share this document with a friend
28
Microservices In Practice Irakli Nadareishvili, Director of Strategy, API Academy CA Technologies
Transcript

Microservices In Practice

Irakli Nadareishvili,

Director of Strategy, API Academy

CA Technologies

2 ©2015CA.ALLRIGHTSRESERVED. inadarei

3 ©2015CA.ALLRIGHTSRESERVED. inadarei

But, why?

4 ©2015CA.ALLRIGHTSRESERVED. inadarei

Microservices can greatly improve your capabilities in:

CONTINUOUSDELIVERY

PRODUCINGEVOLVABLEANDSCALABLEARCHITECTURE

ENABLINGAGILESOFTWAREDEVELOPMENTLIFECYCLE

1

2

3

5 ©2015CA.ALLRIGHTSRESERVED. inadarei

6 ©2015CA.ALLRIGHTSRESERVED. inadarei

COMMUNICATEUSINGLANGUAGE-AGNOSTICAPIS

AREINDEPENDENTLYDEPLOYABLEVIAUNIVERSALCONTAINERS

PRACTICEDECENTRALIZEDDATAMANAGEMENT

1

2

3

Microservices is an architectural style, in which a complex software application is de-composed into smaller components ("micro services") that:

7 ©2015CA.ALLRIGHTSRESERVED. inadarei

Challenge:De-centralized Data Management

8 ©2015CA.ALLRIGHTSRESERVED. inadarei

Tool 1:Think of Capabilities,

not: Data Models

9 ©2015CA.ALLRIGHTSRESERVED. inadarei

Bounded Contexts

10 ©2015CA.ALLRIGHTSRESERVED. inadarei

Eric Evans: Bounded ContextsAn application domain consists of multiple bounded contexts. Residing within each BC are models that do not need to be shared outside, as well as other models that are shared externally.

11 ©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

12 ©2015CA.ALLRIGHTSRESERVED. inadarei

Caution: DDD and Bounded Context Identification

Are Far From Trivial or Easy Tasks

13 ©2015CA.ALLRIGHTSRESERVED. inadarei

Domain-Driven Design – More Information

Eric Evans: "Domain-Driven Design: Tackling Complexity in the Heart of Software" - 2003

Vaughn Vernon: "Implementing Domain-Driven Design" - 2013

Scott Millett: "Patterns, Principles, and Practices of Domain-Driven Design" - 2015

14 ©2015CA.ALLRIGHTSRESERVED. inadarei

Tool 2: Event Sourcing & CQRS

15 ©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

16 ©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

17 ©2015CA.ALLRIGHTSRESERVED. inadarei

Deposit Money Microservice

Deposit MessageQueue EventStore(e.g.Cassandra)

Transactions List/Query Microservice

Query IndexStore(e.g.ElasticSearch)

Validation

18 ©2015CA.ALLRIGHTSRESERVED. inadarei

What About Them Transactions?

19 ©2015CA.ALLRIGHTSRESERVED. inadarei

Tool 3: Sagas (Long-LivedDistributedTransactions)

20 ©2015CA.ALLRIGHTSRESERVED. inadarei

Booking Travel

21 ©2015CA.ALLRIGHTSRESERVED. inadarei

No Shared State = No Distr. Transactions

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

We ♥ Sagas!Designedby:HectorGarcia-Molina&KennethSalem,Princeton,1987

22 ©2015CA.ALLRIGHTSRESERVED. inadarei

One More Thing…

23 ©2015CA.ALLRIGHTSRESERVED. inadarei

24 ©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.

25 ©2015CA.ALLRIGHTSRESERVED. inadarei

Many start coarse-grained and become more granular over time.

That said, companies that have been building Microservices for long, report that they end with hundredsof Microservices.

26 ©2015CA.ALLRIGHTSRESERVED. inadarei

Where do we gethundreds of servers?

27 ©2015CA.ALLRIGHTSRESERVED. inadarei

How do we afford so many servers?

DirectorofStrategy,APIAcademyIrakliNadareishvili

@inadarei

@apiacademy

@cainc


Recommended