Microservices Modularity - Linux Foundation Events

8 downloads 248 Views 5MB Size Report
Mar 17, 2015 - Infrastructure Automation. Design for failure ... Infrastructure Automation. Design for failure ... vendo
Microservices and

Modularity or the difference between

treatment and

cure Milen Dyankov @milendyankov MARCH 17, 2015

~$ pidof java

~$ pidof java 9927 2151 ~$

~$ pidof java 9927 2151 ~$ ps aux | grep java | grep -v grep | awk '{print $2}'

~$ pidof java 9927 2151 ~$ ps aux | grep java | grep -v grep | awk '{print $2}' 2151 9927 ~$

Monolith ~$ pidof java 9927 2151 ~$ ps aux | grep java | grep -v grep | awk '{print $2}' 2151 9927 ~$

Microservices

What are Microservices

Microservices characteristics! Componentization via Services Organized around Business Capabilities Products not Projects Smart endpoints and dumb pipes Decentralized Governance Decentralized Data Management Infrastructure Automation Design for failure Evolutionary Design

50% not strictly software but rather operations related! Componentization via Services Organized around Business Capabilities Products not Projects Smart endpoints and dumb pipes Decentralized Governance Decentralized Data Management Infrastructure Automation Design for failure Evolutionary Design

Why consider Microservices

Reducing the complexity of Monoliths wrong but common answer

...

...

...

or

...

...

∞ or

...

... ...

∞ or

...

Reduced complexity !!!

... ...

∞ or

...

... then all you are doing is shifting complexity from inside a component to the connections between components. ... it moves it to a place that's less explicit and harder to control.

What's cool about Microservices

“The real power ... is the ability for a developer to develop a single entity and then deploy that component multiple times” “Highly Scalable, Robust, Architecture” “In very straightforward terms ... is a component model for building portable, reusable and scalable business components ... for distributed environment.”

Quotes from articles about EJB ( 1999 – 2002 )

“The real power ... is the ability for a developer to develop a single entity and then deploy that component multiple times” www.onjava.com/pub/a/onjava/2001/12/19/eejbs.html

“Highly Scalable, Robust, Architecture” www.dhlee.info/computing/ejb/reference/seybold_ejb.pdf

“In very straightforward terms ... is a component model for building portable, reusable and scalable business components ... for distributed environment.” www.idt.mdh.se/kurser/ct3340/archives/ht08/papersRM08/37.pdf

... Companies worldwide have overspent about $1 billion ... vendors are encouraging customer to buy high-end technology that they don't need.

Who is doing Microservices

microservices

microservices

What do they have in common ?

microservices

They build microservices for

their own needs !

microservices

They build microservices for

their own needs ! This makes it easer for them to grow the DevOps culture hire the right people accept “Decentralized” approach automate infrastructure

... a technique that is more effective for a more skillful team isn't necessarily going to work for less skillful teams ... A poor team will always create a poor system ...

Should I do Microservices

microservices

Does your organization fit into that space?

... you shouldn't start with a microservices architecture. Instead begin with a monolith,

keep it modular , and split it into microservices once the monolith becomes a problem. ...

What else, if not Microservices

Microservices do not

cure complexity! Actually nothing does !

The term "cure " means that, after medical treatment, the patient

no longer has that particular condition anymore . Some diseases have no cure . The patient will always have the condition, but treatment can help to manage it .

Good treatment for complexity is enforcing

clean modular architecture

... The Deployment Model is a Detail. ...

there is no such thing as a micro-service architecture. Micro-services are a deployment option ...

Interesting !?! But in my project it's not possible because of . . . Really ?!?

Modularizing “Duke's forest” JEE tutorial demo! https://github.com/azzazzel/modular-dukes-forest

Glassfish

Sh

g in p i p EJB

Pay

A, F P J JS

men

E JB

Model JPA

Store JPA, EJB JSF

t

EJB controllers

JEE container

OSGi services OSGi runtime

Catalog usecase

P di ort sp le la t y

us mm ec e as r c e e

co

ity nt se e a Id ec s u

A JP nce s te

rsi

In me pe r s mo r y ist en ce

E-

pe

SpringBoot

Database

Domain Model

F JS lay p dis

Liferay

EJB controllers

JEE container

OSGi services OSGi runtime

Catalog usecase

P di ort sp le la t y

us mm ec e as r c e e

co

ity nt se e a Id ec s u

A JP nce s te

rsi

In me pe r s mo r y ist en ce

E-

pe

SpringBoot

Database

Domain Model

F JS lay p dis

Liferay

EJB controllers

JEE container

OSGi services OSGi runtime

Catalog usecase

P di ort sp le la t y

us mm ec e as r c e e

co

ity nt se e a Id ec s u

A JP nce s te

rsi

In me pe r s mo r y ist en ce

E-

pe

SpringBoot

Database

Domain Model

F JS lay p dis

Liferay

EJB controllers

JEE container

OSGi services OSGi runtime

Catalog usecase

P di ort sp le la t y

us mm ec e as r c e e

co

ity nt se e a Id ec s u

A JP nce s te

rsi

In me pe r s mo r y ist en ce

E-

pe

SpringBoot

Database

Domain Model

F JS lay p dis

Liferay

EJB controllers

JEE container

OSGi services OSGi runtime

Catalog usecase

P di ort sp le la t y

us mm ec e as r c e e

co

ity nt se e a Id ec s u

A JP nce s te

rsi

In me pe r s mo r y ist en ce

E-

pe

SpringBoot

Database

Domain Model

F JS lay p dis

Liferay

http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html

Modularity Is a important software architecture concept!

One can design modular application without

Microservices

The OSGi specification describes a modular system and a service platform for the Java programming language

The architecture of choice for

Confluence Eclipse Fuse ESB Glassfish Jboss JIRA and JonAS Service Mix Weblogic Websphere ...

Same characteristics but more flexible ! Componentization via Services Organized around Business Capabilities Products not Projects Smart endpoints and dumb pipes Decentralized Governance Decentralized Data Management Infrastructure Automation Design for failure Evolutionary Design

This is not theory! We do this at

We are transforming a huge code base into small simple core and OSGi (micro)services! We have so far extracted over 80 apps and we are not done yet!

[email protected] http://www.liferay.com/web/milen.dyankov/ @milendyankov @LiferayPL

http://www.liferay.com @Liferay http://www.facebook.com/Liferay