Micro services, reactive manifesto and 12-factors

Post on 15-Jul-2015

984 views 2 download

Tags:

transcript

Micro-Services, the

Reactive Manifesto, and

12-FactorsDejan Glozic, IBM Canada

ReactiveTO, July 2014

About me

Dejan Glozic, Full-Stack Architect

IBM Canada Toronto Laboratory

@dglozic

http://dejanglozic.com

Meetup reaction

Disambiguation:

• Reactionary

• Reactive pattern

• Reactive.js

We are not exactly

short on manifestosCan you name a few?

Still, why worry?

Manifesto trends

0

15

30

45

60

XVI XVII XVIII XIX XX XXI

Nota

ble

Manifesto

s

Centuries

Artistic Technical Technical (projected) Political

Adding more causes

inflationWe are reducing the value and impact of manifestos

Or even hyper-inflationHow bad can it be?

This badInflation is bad, don’t do inflation… mmm kay?

Another thing to avoidFounders giving up on their own manifestos

Resulting in…Russ Miles blog-blocking the creation of a Micro-service

Manifesto

Microbe-serviceChlamydia is a nasty STD, don’t do Chlamydia…

mmmkay?

Don’t:

• Create too many new manifestos

• Go through them like dirty socks

• Make them compete with each other

Do

• Use manifestos as building blocks

• Make new manifestos add to the growing

understanding

–A Thespian from Utah

“We can have our Kate and Edith too.”

Mental exerciseMerge 12-factors, reactive manifesto and micro-services

The Twelve-Factor

AppAdam Wiggins, Heroku co-founder

12-Factors use Roman

numeralsBecause they make the manifestos sound L% more

effective.

Factors I-IV

I. One codebase, many deploys

II. Declare and isolate dependencies

III. Separate config from code

IV. Treat backing services as attached resources

Factors V-VIII

V. Strictly separate build, release and run stages

VI. Execute apps as share-nothing processes

VII.Export services via port binding

VIII.Scale out via the process model

Factors IX-XII

IX. Fast startup, graceful shutdown

X. Dev/Prod parity

XI. Treat logs as event streams

XII.Run admin/mgmt tasks as one-off processes

12-factors are great……but they only answer ‘How’, not ‘Why’ and ‘What’

Then came Reactive

Manifesto…but Kevin already told you what it is about

Why Reactive?

So that our system can be reactive to:

• Events

• Load

• Failure

• Users

Micro-servicesThe third ingredient

Micro-service frenzyThey even cause Twitter food fights

Sigh…We cannot even agree what it is

Micro-service system

• Many micro-services instead of a monolith

• Do one thing and do it right

• Deploy micro-services independently

• Communicate using message queues

• Cluster locally

Example - feature gridHorizontal - tiers, vertical - features.

Example - eventsRabbitMQ between micro-services, WebSockets for

server push

Example - clusteringRabbitMQ worker queue, round-robin to micro-service

workers

Everything snaps into

focusWe now have our What, Why and How

What?A distributed system based on micro-services that

communicate via message queues

Why?Because we want our system to be reactive to events,

load, failure and users.

How?By implementing micro-services as well-behaved 12-

factor apps

1 4 12CONCEPT TENETS FACTORS

This was funLet’s hope consultants don’t ruin Reactive the way they

did Agile

#!$@*!!

Questions?

Thank you!@dglozic

http://dejanglozic.com