際際滷

際際滷Share a Scribd company logo
HOW TO DISASSEMBLE
A MONOLITHIC APPS IN
(NOT-SO) MICRO-SERVICES
ROME 18 - 19 MARCH 2016
MICHELE
FRANZIN
@REALFUZZY
INTEREST IN
#MICROSERVICES
Trasformare un'applicazione monolitica in microservices (versione #daje)
PARTNERS
12.000
TRANSACTIONS/MONTH
in just an hour
DISCLAIMER
my personal opinion
people have different experiences
ideas, comment, etc contact me @realfuzzy
subject is wide, so Id love to hear your thoughts :-)
Its not a code talk (but you can see some sources)
AGENDA:THERES NO
AGENDA
Ive got a tale instead
Trasformare un'applicazione monolitica in microservices (versione #daje)
Trasformare un'applicazione monolitica in microservices (versione #daje)
Trasformare un'applicazione monolitica in microservices (versione #daje)
BUAHAHAHAHA!
I AM THE
MONOLITH!
COME TO THE
WORLD TO BRING
IMMOBILISM AND
COMPLEXITY!
THE
MONOLITH
easy to develop
IDEs & development
tools support
easy to test
simple to deploy
works well for
relatively small apps
AFTER A WHILE
http://www.qcodemag.it/wp-content/uploads/2014/09/favela.jpg
growth overloads
everything
dif鍖cult to adopt new
technologies
often stuck with the
starting choices
doesnt scale to
long-lived application
MONOLITH
ARCHITECTURE ARCHITECTURE
MICROSERVICEIC
ARCHITECTURE
is the keyword
WHY MICROSERVICES
 suite of small services
 running in its own process
 communicating with lightweight mechanisms
 built around business capabilities
 independently automated deployable
 technology agnostic
Trasformare un'applicazione monolitica in microservices (versione #daje)
EXPECTATIONS
http://www.wallpaperawesome.com/wallpapers-awesome/
relatively small
easier to understand
easier to scale
development
improve fault isolation
develop & deploy
independently
no vendor lock
improves
tuning & scaling
- additional complexity of a distributed system
- tools/IDEs are monolithic applications oriented
- testing is more dif鍖cult
- must implement the inter-service communication
- increase memory consumption
AGENDA*
 whats a microservice?
 why have I to jump in ?
 where I can start from ?
 how I should be aware of ?
* I know, I know, I lied about the agenda
 Martin Fowler, Chief Scientist -ThoughtWorks
dont even consider microservices
unless you have a system that's too
complex to manage as a monolith
YAGNI
do monolith 鍖rst
monolith
microservice
complexity
productivity
http://martinfowler.com/bliki/MicroservicePremium.html
 Sam Newman, author of Building Microservices
I remain convinced that it is much easier
to partition an existing [] system than
to do so up front
You have more to work with.
HOPE vs REALITY
http://martinfowler.com/articles/dont-start-monolith.html
Trasformare un'applicazione monolitica in microservices (versione #daje)
THE NEW
BEGINNING
https://upload.wikimedia.org/wikipedia/commons/6/67/Change_In_Hand.jpg
Q0: HOW TO DECOMPOSE A
MONOLITH?
1. Identify business boundaries
2. start decomposing each into own microservice
3. follow the Single Responsibility Principle
4. goto :2
Trasformare un'applicazione monolitica in microservices (versione #daje)
Sir. Tools
A warrior that can
use every kind of
tool as a weapon
Strateky Sensei
Master renowned
for its strategic and
tactical ability
Workodoo Master
The work-force is
strong with this one
Trasformare un'applicazione monolitica in microservices (versione #daje)
Trasformare un'applicazione monolitica in microservices (versione #daje)
HAHAHAHA!
YOUR EFFORTS
ARE NOT
ENOUGH TO
DEFEAT ME!
Your efforts have little effect!
an orthogonal approach might
help you ...
MANY
SERVICES THAT
COMMUNICATE ?
http://www.raptorsrepublic.com/
MESSAGING
XP
S2
S1
MESSAGE BUS
XP1
S2
S1
P2
S3
CHOOSE WISELY
 Reliability
 Routing algorithms
 Highly Availability
 Supported protocols
OUR CHOICE  RABBITMQ
 AMPQ message broker
 Erlang
 Fast, reliable, secure
 Many clients
 Commercial support
HERE!
SPECIFICATION IS A MUST
(no matter what)
JSON-LD
JSON-API HAL
DIY
DESIGN FOR FAILURE
aka: communicate when communication is hard
CIRCUIT BREAKER
https://www.鍖ickr.com/photos/leafbug/409950515/
http://martinfowler.com/bliki/CircuitBreaker.html
STOPLIGHT
https://github.com/orgsync/stoplight
HOW IT LOOKS LIKE
9XL
Trasformare un'applicazione monolitica in microservices (versione #daje)
Trasformare un'applicazione monolitica in microservices (versione #daje)
Trasformare un'applicazione monolitica in microservices (versione #daje)
 Melvin Conway, 1968
organizations which design systems 
are constrained to produce designs
which are copies of the communication
structures of these organizations
THE INVERSE
CONWAY MANEUVER
 Martin Fowler, Chief Scientist -ThoughtWorks
For many people throwing away a code
base is a sign of failure, perhaps
understandable , but still failure.
SACRIFICIAL
ARCHITECTURE
http://www.cardhub.com/edu/credit-cards-expiration-date
POLYGLOT IS NICE
but mother tongue is fair enough
DEVOPS!
no devops?!? no party.
https://www.鍖ickr.com/photos/91657289@N02/10218392744
CONTINUOUS DEPLOYMENT
FOR RUBY GEMS
The Smith
Master craftsman
expert in forging
anything
The Sculptor
An artist able to
give shape to
magni鍖cent works
The Painter
Colors and shapes
come to life on her
canvas!
Trasformare un'applicazione monolitica in microservices (versione #daje)
Trasformare un'applicazione monolitica in microservices (versione #daje)
Trasformare un'applicazione monolitica in microservices (versione #daje)
Trasformare un'applicazione monolitica in microservices (versione #daje)
Trasformare un'applicazione monolitica in microservices (versione #daje)
Trasformare un'applicazione monolitica in microservices (versione #daje)
NO MONOLITHS WERE
HARMED INTHE MAKING
OFTHIS PRESENTATION
andreabrigu@gmail.com
@BriguGraphic
Illustrated by:
TAKEAWAYS
go monolith 鍖rst
communication (all-around) is strategic assets
start simple, then dont fear the change
take decisions, I-REALLY-MEAN-THAT
WHATS NEXT ?
 testing
 CQRS + ES
 log analisys & monitoring
 metrics
Thank you.
@realfuzzy
Michele Franzin

More Related Content

Trasformare un'applicazione monolitica in microservices (versione #daje)