![Page 1: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/1.jpg)
APRIL 20, 2015
Microservicesand
Modularityor
the difference between
treatmentand
cureMilen Dyankov@milendyankov
![Page 2: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/2.jpg)
~$ pidof java
![Page 3: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/3.jpg)
~$ pidof java9927 2151~$
![Page 4: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/4.jpg)
~$ pidof java9927 2151~$ ps aux | grep java | grep -v grep | awk '{print $2}'
![Page 5: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/5.jpg)
~$ pidof java9927 2151~$ ps aux | grep java | grep -v grep | awk '{print $2}'21519927~$
![Page 6: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/6.jpg)
~$ pidof java9927 2151~$ ps aux | grep java | grep -v grep | awk '{print $2}'21519927~$
Monolith
Microservices
![Page 7: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/7.jpg)
What are
Microservices
![Page 8: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/8.jpg)
Componentization via ServicesOrganized around Business CapabilitiesProducts not ProjectsSmart endpoints and dumb pipesDecentralized GovernanceDecentralized Data ManagementInfrastructure AutomationDesign for failureEvolutionary Design
Microservices characteristics!
![Page 9: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/9.jpg)
Componentization via ServicesOrganized around Business CapabilitiesProducts not ProjectsSmart endpoints and dumb pipesDecentralized GovernanceDecentralized Data ManagementInfrastructure AutomationDesign for failureEvolutionary Design
50% not strictly software butrather operations related!
![Page 10: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/10.jpg)
Why consider
Microservices
![Page 11: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/11.jpg)
wrong but common answer
Reducing the complexity of Monoliths
![Page 12: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/12.jpg)
![Page 13: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/13.jpg)
. . .
![Page 14: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/14.jpg)
. . .
![Page 15: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/15.jpg)
. . .
![Page 16: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/16.jpg)
. . .or
![Page 17: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/17.jpg)
. . .or
. . .∞
![Page 18: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/18.jpg)
. . .or
. . .∞
. . .
![Page 19: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/19.jpg)
. . .or
. . .
Reduced complexity !!!
∞
. . .
![Page 20: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/20.jpg)
. . .
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.
![Page 21: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/21.jpg)
Microservices
What's cool about
![Page 22: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/22.jpg)
“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 forbuilding portable, reusable and scalable business
components ... for distributed environment.”
![Page 23: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/23.jpg)
“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 forbuilding portable, reusable and scalable business
components ... for distributed environment.”www.idt.mdh.se/kurser/ct3340/archives/ht08/papersRM08/37.pdf
Quotes from articles about EJB ( 1999 – 2002 )
![Page 24: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/24.jpg)
. . .
Companies worldwide have overspent about $1 billion
. . .
vendors are encouraging customer to buy
high-end technology that they don't need.
![Page 25: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/25.jpg)
Who is doing
Microservices
![Page 26: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/26.jpg)
microservices
![Page 27: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/27.jpg)
microservices
What do they have in common ?
![Page 28: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/28.jpg)
microservices
They buildmicroservices for
their own needs!
![Page 29: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/29.jpg)
microservices
They buildmicroservices for
their own needs!
This makes it easer for them to grow the DevOps culture hire the right people accept “Decentralized” approach automate infrastructure
![Page 30: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/30.jpg)
. . .
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
. . .
![Page 31: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/31.jpg)
Should I do
Microservices
![Page 32: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/32.jpg)
microservices
Does your organization fit into that space?
![Page 33: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/33.jpg)
. . .
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.
. . .
![Page 34: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/34.jpg)
Microservices
What else, if not
![Page 35: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/35.jpg)
Microservices do not
cure complexity!
Actually nothing does !
![Page 36: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/36.jpg)
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.
![Page 37: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/37.jpg)
Good treatment for complexity is enforcing
clean modular
architecture
![Page 38: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/38.jpg)
. . .
The Deployment Model is a Detail.. . .
there is no such thing as a micro-service
architecture.Micro-services are a
deployment option . . .
![Page 39: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/39.jpg)
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
![Page 40: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/40.jpg)
ModelJPA
StoreJPA, EJB
JSF
Shipping
JPA, EJB
JSF
Payment EJB
Glassfish
![Page 41: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/41.jpg)
DomainModel
Catalogusecase
Identity
usecase E-com
merc
e
usecaseJ
PA
pe
rsistence
In-memorypersistence
EJBcontrollers
OSGiservices
Portle
tdis
play
JSF
display
JEEcontainer
SpringBoot
OSGiruntime
Liferay
Database
![Page 42: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/42.jpg)
DomainModel
Catalogusecase
Identity
usecase E-com
merc
e
usecaseJ
PA
pe
rsistence
In-memorypersistence
EJBcontrollers
OSGiservices
Portle
tdis
play
JSF
display
JEEcontainer
SpringBoot
OSGiruntime
Liferay
Database
![Page 43: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/43.jpg)
DomainModel
Catalogusecase
Identity
usecase E-com
merc
e
usecaseJ
PA
pe
rsistence
In-memorypersistence
EJBcontrollers
OSGiservices
Portle
tdis
play
JSF
display
JEEcontainer
SpringBoot
OSGiruntime
Liferay
Database
![Page 44: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/44.jpg)
DomainModel
Catalogusecase
Identity
usecase E-com
merc
e
usecaseJ
PA
pe
rsistence
In-memorypersistence
EJBcontrollers
OSGiservices
Portle
tdis
play
JSF
display
JEEcontainer
SpringBoot
OSGiruntime
Liferay
Database
![Page 45: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/45.jpg)
DomainModel
Catalogusecase
Identity
usecase E-com
merc
e
usecaseJ
PA
pe
rsistence
In-memorypersistence
EJBcontrollers
OSGiservices
Portle
tdis
play
JSF
display
JEEcontainer
SpringBoot
OSGiruntime
Liferay
Database
![Page 46: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/46.jpg)
http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html
![Page 47: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/47.jpg)
Microservices
ModularityIs a important software architecture concept!
One can design modular application without
![Page 48: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/48.jpg)
The OSGi specification describes a modular system and a service platform for the
Java programming language
ConfluenceEclipse
Fuse ESB Glassfish
JbossJIRA
JonASService Mix
WeblogicWebsphere
. . .
The architecture of choice for
and
![Page 49: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/49.jpg)
Componentization via ServicesOrganized around Business CapabilitiesProducts not ProjectsSmart endpoints and dumb pipesDecentralized GovernanceDecentralized Data ManagementInfrastructure AutomationDesign for failureEvolutionary Design
Same characteristics but more flexible !
![Page 50: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/50.jpg)
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!
This is not theory! We do this at
![Page 51: 4Developers 2015: Microservices and Modularity or the difference between treatment and cure! - Milen Dyankov](https://reader034.vdocuments.us/reader034/viewer/2022042701/55b77450bb61eb52538b47bd/html5/thumbnails/51.jpg)
http://www.liferay.com/web/milen.dyankov/
@milendyankov@LiferayPL
http://www.liferay.com
@Liferay
http://www.facebook.com/Liferay