SlideShare a Scribd company logo
Committed to innovate
LINKVALUE
JEAN-MARIE
LAMODIERE
Build microservices
since 07/2015
@JMLamodiere
LES MICROSERVICES,
C'EST PAS AUTOMATIQUE !
Linkvalue | Jean-Marie Lamodière
2
Microservices? Think twice!
1935 CP
Linkvalue | Jean-Marie Lamodière
ASHAMED OF YOUR MONOLITH?

Spaghetti code

Side effects

Team velocity decreasing

Hard to refactor

Bugs
3
Linkvalue | Jean-Marie Lamodière
4
Linkvalue | Jean-Marie Lamodière
5
Linkvalue | Jean-Marie Lamodière
PROBLEMS THEY SOLVE
1.Autonomy
2.Autonomy
3.Autonomy
6
Linkvalue | Jean-Marie Lamodière
PROBLEMS THEY SOLVE
1.Autonomy : deployment
2.Autonomy : langage, framework
3.Autonomy : scalability
7
Linkvalue | Jean-Marie Lamodière
8
Linkvalue | Jean-Marie Lamodière
WHY AUTONOMY MATTERS?

Loosely coupled organisation
= less coupled systems

Quality audit on windows vista :
organizational structures
= most important factor!

Team accountability
9
Linkvalue | Jean-Marie Lamodière
OTHER KEY BENEFITS

Easier for newcomers

Allows isolated POC

Teams scalability

Simpler code design

Easy refactoring
10
Linkvalue | Jean-Marie Lamodière
WHO USES IT?

Uber

Netflix

Amazon

Ebay

Sound Cloud

Groupon
11

Guilt

Zalando

Spotify

Meetic

M6 Web

Auchan
Linkvalue | Jean-Marie Lamodière
« Trade-offs » appears 24x
in « Building Microservices » book
12
Linkvalue | Jean-Marie Lamodière
13
Linkvalue | Jean-Marie Lamodière
TESTIMONY
(45' talks published on )

« We had to fall back to a monolith,
and retry when ready » – SAMUEL ROZE
PHP Tour 2016 • Prenons soin de nos microservices

« I wish I had known... » – MATT RANNEY
GOTO 2016 • What I Wish I Had Known
Before Scaling Uber to 1000 Services
14
Linkvalue | Jean-Marie Lamodière
15
Linkvalue | Jean-Marie Lamodière
WHAT IS SO COMPLEX ?

Boundaries : hard to find / change

Huuuge dev-ops stack

Distributed system

Failure handling

Monitoring

End-to-end testing
16
Linkvalue | Jean-Marie Lamodière
17
Linkvalue | Jean-Marie Lamodière
BOUNDARIES : WHERE TO SPLIT?

Splitting = hard to change

Size ? Small enough, not smaller

Splitting by technical layers? no!

Things that should change together
(« S » in S.O.L.I.D.)

Loose coupling, high cohesion
18
Linkvalue | Jean-Marie Lamodière
DDD* TO THE RESCUE!
(* Domain Driven Design)
Toolset to help domain experts
and developers to refine and
share domain knowledge, reflect it in
the code base, and prioritize efforts.
19
Linkvalue | Jean-Marie Lamodière
MAKE THE IMPLICIT, EXPLICIT!
20
Copyright @DDDreboot ;)
Linkvalue | Jean-Marie Lamodière
SPLIT BY BOUNDED CONTEXT

Bounded context = Team sharing
the same « ubiquitous language »
(same terms)

Vertical, business-focus slice
21
Linkvalue | Jean-Marie Lamodière
WHEN TO SPLIT ?

When ready : technical stack chosen,
architectural decisions taken,
devs and ops willing to go,
autonomous 2 pizza feature teams

When sure of a splitting point

Start with a monolith (!) to find them
22
Linkvalue | Jean-Marie Lamodière
CONWAY'S LAW
« Organizations which design systems
are constrained to produce designs
which are copies of the communication
structures of these organizations »
23
Linkvalue | Jean-Marie Lamodière
2ND LAW OF CONSULTING
(Gerald Weinberg)
24
Linkvalue | Jean-Marie Lamodière
SPLITTING STRATEGY

Implement double-writing
(microservice or legacy side)

Publish needed messages

One-shot data import script

Assert data is sync

Read from microservice
25
Linkvalue | Jean-Marie Lamodière
COMMUNICATION BETWEEN µS

No shared database!

Language agnostic (ex : rest / json)

If weakly typed (json), have a clear doc
(optional? nullable?) or json-schema

Keep consistency. ex : pagination

Define minimal customer-centric api
26
Linkvalue | Jean-Marie Lamodière
COMMUNICATION BETWEEN µS
27
Linkvalue | Jean-Marie Lamodière
28
Linkvalue | Jean-Marie Lamodière
SYNCHRONOUS COMMUNICATION
- PROS -

Easier to understand
(= method call)

Easier transition from monolith

Instant feedback to the client
29
Linkvalue | Jean-Marie Lamodière
SYNCHRONOUS COMMUNICATION
3030
User
Optin
Other service
depending on
1 optin
Register
Register
french user
Read 1 optin
Read
Linkvalue | Jean-Marie Lamodière
SYNCHRONOUS COMMUNICATION
- CONS -

Fanout : 1% slow calls more
probable when cascading calls

Beware of coupling !

Beware of distributed monolith !!
31
32
« Distributed monolith »
@tiffyshindo
Linkvalue | Jean-Marie Lamodière
ASYNCHRONOUS COMMUNICATION

Message broker

Reactive : event driven

Choregraphy over orchestration

Autonomy over authority :
each service copy the data it needs

Work well with CQRS / ES
33
Linkvalue | Jean-Marie Lamodière
ASYNCHRONOUS COMMUNICATION
34
Message brokerMessage broker
Message brokerMessage broker
User French user registered
Optin User optins changed
Other service
depending on
1 optin
Register
Read
Linkvalue | Jean-Marie Lamodière
COMMUNICATION TRAPS

Chatty communication = coupling
feature envy, wrong splitting…

Perf overhead : define « acceptable »
35
Linkvalue | Jean-Marie Lamodière
36
Linkvalue | Jean-Marie Lamodière
DESIGN FOR FAILURE

It will fail, have a plan!

Define what to do, to return

Define timeout for each call

Message hospital (dead letter queue)

Circuit breaker / back pressure

Blameless culture needed
37
Linkvalue | Jean-Marie Lamodière
NETFLIX CHAOS MONKEY

Randomly shut
down services

Cure developers
optimism ;)
38
Linkvalue | Jean-Marie Lamodière
SERVICE DISCOVERY

Each µs scales individualy : which
IP should we call ?

DNS in front of a load-balancer

Kubernetes services

Docker Swarm discovery
(libkv + consul/etcd/zookeeper)
39
Linkvalue | Jean-Marie Lamodière
CAP THEOREM
(Distributed Systems)

Choose 2 between consistency (C),
availability (A) and partition (P)

Avoid distributed transactions

Embrase eventual consistency

Use idempotent operations

Worker to clean inconsistency
40
Linkvalue | Jean-Marie Lamodière
41
Linkvalue | Jean-Marie Lamodière
MICROSERVICES CLIENTS

Libraries ok, 1 per language needed

No business logic in client :
avoid anemic CRUD microservices

To call a complex api (legacy,
external), build a facade service
42
Linkvalue | Jean-Marie Lamodière
CHANGE PROOF CLIENTS

Old and new api should cohexist

Postel's law : « be conservative in
what you do, be liberal in what you
accept from others »

Tolerant reader (Martin Fowler) :
ignore changes not impacting you
43
Linkvalue | Jean-Marie Lamodière
CHANGE PROOF CLIENTS
44
Linkvalue | Jean-Marie Lamodière
API GATEWAY

Avoid exposing µs to frontend

Hide spliting to new microservices

Handle authentication / roles

Pro-tips : Back-end for frontend,
1 gateway per front application
45
Linkvalue | Jean-Marie Lamodière
API GATEWAY
46
Microservice
Legacy
Monolith
Microservice Microservice
Android
API Gateway
Android
application
Public
Private
ReactJS
Web application
ReactJS
API Gateway
Linkvalue | Jean-Marie Lamodière
47
Linkvalue | Jean-Marie Lamodière
TESTING A MICROSERVICE

No end-to-end testing at µs level

Stub/mock others µs in functional tests

Have consumer-driven tests

No continuous integration = no µs!

One c.i. pipeline per microservice
48
Linkvalue | Jean-Marie Lamodière
END TO END TESTING

Test journeys (main features),
not user stories (already tested)

Goal : check wiring

Should be done in each front app

Can run in production
49
Linkvalue | Jean-Marie Lamodière
TESTING = TRUST
50
Involve a quality assurance member
in your feature team
Linkvalue | Jean-Marie Lamodière
ARCHITECT ROLE

Keep µs map up to date

Define communication between µs

Define automatic deploying,
monitoring and logging strategy

Adapt to change, like a city planner

Enforce team autonomy inside a µs
51
Linkvalue | Jean-Marie Lamodière
52
Linkvalue | Jean-Marie Lamodière
WHAT SHOULD µS KEEP COMMON ?

Rules : communication, logs...

Template to create new µs,
but no synchronization afterward

Violate DRY accross µs !

Shared code = coupling

Priority : autonomy
53
Linkvalue | Jean-Marie Lamodière
MONITORING / LOGGING TIPS

Pass a unique « correlation id »
to each sub-calls, including
messages and asynchronous calls

Make sure your APM supports
each language + versions

Have a look at Sysdig.org
54
Linkvalue | Jean-Marie Lamodière
55

Extreme Programming

TDD / BDD

S.O.L.I.D.

Loose coupling,
high cohesion

DDD

Hexagonal
Linkvalue | Jean-Marie Lamodière
BEFORE YOU START

microservices.io

martinfowler.com
/microservices/
/articles/microservices.html
/articles/microservice-trade-offs.html

groups.google.com
/forum/#!forum/microservices
56
Linkvalue | Jean-Marie Lamodière
ASYNCHRONOUS COMMUNICATION

blog.christianposta.com
Why Microservices Should Be
Event Driven:Autonomy vs Authority

reactivemanifesto.org
57
Lightbend.com (free)
Linkvalue | Jean-Marie Lamodière
TALKS

What I Wish I Had Known Before
Scaling Uber to 1000 Services
GOTO 2016 • Matt Ranney

Prenons soin de nos microservices
PHP Tour 2016 • SAMUEL ROZE

Meetic backend mutation with Symfony
SymfonyLive 2015 • J. Calabrese E. Broutin

Kafka event architecture at Meetic
Forum PHP 2015 • B. Pineau M. Robin
58
Linkvalue | Jean-Marie Lamodière
DDD RECOMMENDED BOOKS
59
leanpub.com (free)
Thank you!
Linkvalue | Jean-Marie Lamodière
60
Committed to innovate
LINKVALUE JEAN-MARIE
LAMODIERE
Build microservices
since 07/2015
@JMLamodiere
1935 CP

More Related Content

Viewers also liked

Yachay 10
Yachay 10Yachay 10
Yachay 10Jean Px
 
Animales que me rodean
Animales que me rodeanAnimales que me rodean
Animales que me rodeanespagar
 
Plan de gestion uso tic diapositivas
Plan de gestion uso tic diapositivasPlan de gestion uso tic diapositivas
Plan de gestion uso tic diapositivasNadin Villadiego
 
Mujeres lectoras impenitentes
Mujeres lectoras impenitentesMujeres lectoras impenitentes
Mujeres lectoras impenitentesluiscarbajo
 
Día do Libro no Martín Sarmiento
Día do Libro no Martín SarmientoDía do Libro no Martín Sarmiento
Día do Libro no Martín Sarmientoluiscarbajo
 
Mujeres lectoras impenitentes
Mujeres lectoras impenitentesMujeres lectoras impenitentes
Mujeres lectoras impenitentesluiscarbajo
 
Yachay 5
Yachay 5Yachay 5
Yachay 5Jean Px
 
Yachay 29
Yachay 29Yachay 29
Yachay 29Jean Px
 
Estrategiasparalacosechaespiritual 100503201217-phpapp02
Estrategiasparalacosechaespiritual 100503201217-phpapp02Estrategiasparalacosechaespiritual 100503201217-phpapp02
Estrategiasparalacosechaespiritual 100503201217-phpapp02Yesenia Lorena
 
Tutorial informes y formularios
Tutorial informes y formulariosTutorial informes y formularios
Tutorial informes y formulariosSIlvy CHhamorro
 

Viewers also liked (15)

Yachay 10
Yachay 10Yachay 10
Yachay 10
 
Vih sida
Vih  sidaVih  sida
Vih sida
 
Actividad 7
Actividad 7Actividad 7
Actividad 7
 
Animales que me rodean
Animales que me rodeanAnimales que me rodean
Animales que me rodean
 
Plan de gestion uso tic diapositivas
Plan de gestion uso tic diapositivasPlan de gestion uso tic diapositivas
Plan de gestion uso tic diapositivas
 
Actividad 1
Actividad 1Actividad 1
Actividad 1
 
Mujeres lectoras impenitentes
Mujeres lectoras impenitentesMujeres lectoras impenitentes
Mujeres lectoras impenitentes
 
Día do Libro no Martín Sarmiento
Día do Libro no Martín SarmientoDía do Libro no Martín Sarmiento
Día do Libro no Martín Sarmiento
 
Mujeres lectoras impenitentes
Mujeres lectoras impenitentesMujeres lectoras impenitentes
Mujeres lectoras impenitentes
 
My computer is being slow
My computer is being slowMy computer is being slow
My computer is being slow
 
Yachay 5
Yachay 5Yachay 5
Yachay 5
 
Yachay 29
Yachay 29Yachay 29
Yachay 29
 
Estrategiasparalacosechaespiritual 100503201217-phpapp02
Estrategiasparalacosechaespiritual 100503201217-phpapp02Estrategiasparalacosechaespiritual 100503201217-phpapp02
Estrategiasparalacosechaespiritual 100503201217-phpapp02
 
Algebra
AlgebraAlgebra
Algebra
 
Tutorial informes y formularios
Tutorial informes y formulariosTutorial informes y formularios
Tutorial informes y formularios
 

Similar to Les microservices, c'est pas automatique ! - Linkvalue Tech

Common Anti-patterns that Impede a Successful Digital Transformation
Common Anti-patterns that Impede a Successful Digital TransformationCommon Anti-patterns that Impede a Successful Digital Transformation
Common Anti-patterns that Impede a Successful Digital TransformationGautham Pallapa
 
Building DevOps in the Enterprise: Balancing Centralized and Decentralized Teams
Building DevOps in the Enterprise: Balancing Centralized and Decentralized TeamsBuilding DevOps in the Enterprise: Balancing Centralized and Decentralized Teams
Building DevOps in the Enterprise: Balancing Centralized and Decentralized TeamsDevOps.com
 
Clone Clone Make: a better way to build
Clone Clone Make: a better way to buildClone Clone Make: a better way to build
Clone Clone Make: a better way to buildDanHeidinga
 
External should that be a microservice
External should that be a microserviceExternal should that be a microservice
External should that be a microserviceRohit Kelapure
 
First Caracas MuleSoft Meetup Slides
First Caracas MuleSoft Meetup SlidesFirst Caracas MuleSoft Meetup Slides
First Caracas MuleSoft Meetup SlidesFernando Silva
 
David Leslie - Testing at MACH Speed.pptx
David Leslie - Testing at MACH Speed.pptxDavid Leslie - Testing at MACH Speed.pptx
David Leslie - Testing at MACH Speed.pptxQA or the Highway
 
Sea spin5 2013-notes
Sea spin5 2013-notesSea spin5 2013-notes
Sea spin5 2013-notesJeff Smith
 
Making microservices work
Making microservices workMaking microservices work
Making microservices workJeremey Barrett
 
Multi-Agency Multi-Media Interoperable Communication, Enabled By Redis: Paul ...
Multi-Agency Multi-Media Interoperable Communication, Enabled By Redis: Paul ...Multi-Agency Multi-Media Interoperable Communication, Enabled By Redis: Paul ...
Multi-Agency Multi-Media Interoperable Communication, Enabled By Redis: Paul ...Redis Labs
 
Let's talk about Coded Automation
Let's talk about Coded AutomationLet's talk about Coded Automation
Let's talk about Coded AutomationUiPathCommunity
 
Continuously Delivering Distributed Systems
Continuously Delivering Distributed SystemsContinuously Delivering Distributed Systems
Continuously Delivering Distributed SystemsDaniel Löffelholz
 
Growing as a software craftsperson (part 1) From Pune Software Craftsmanship.
Growing as a software craftsperson (part 1)  From Pune Software Craftsmanship.Growing as a software craftsperson (part 1)  From Pune Software Craftsmanship.
Growing as a software craftsperson (part 1) From Pune Software Craftsmanship.Dattatray Kale
 
Lean Software Development & Kanban
Lean Software Development & KanbanLean Software Development & Kanban
Lean Software Development & KanbanRishi Chaddha
 
Microservices: Why and When? - Alon Fliess, CodeValue - Cloud Native Day Tel ...
Microservices: Why and When? - Alon Fliess, CodeValue - Cloud Native Day Tel ...Microservices: Why and When? - Alon Fliess, CodeValue - Cloud Native Day Tel ...
Microservices: Why and When? - Alon Fliess, CodeValue - Cloud Native Day Tel ...Cloud Native Day Tel Aviv
 
Novel_Value_Stream_Analysis_for_SAFe_-_ver_8.pdf
Novel_Value_Stream_Analysis_for_SAFe_-_ver_8.pdfNovel_Value_Stream_Analysis_for_SAFe_-_ver_8.pdf
Novel_Value_Stream_Analysis_for_SAFe_-_ver_8.pdfMaarit Laanti
 
Measuring Performance: See the Science of DevOps Measurement in Action
Measuring Performance: See the Science of DevOps Measurement in ActionMeasuring Performance: See the Science of DevOps Measurement in Action
Measuring Performance: See the Science of DevOps Measurement in ActionXebiaLabs
 
Improve existing code with confidence, supported by unit tests
Improve existing code with confidence, supported by unit testsImprove existing code with confidence, supported by unit tests
Improve existing code with confidence, supported by unit testsDattatray Kale
 
Meetup slide 20_apr
Meetup slide 20_aprMeetup slide 20_apr
Meetup slide 20_aprSantosh Ojha
 
Settlers of DevOps - DevOpsDays Boston 2017
Settlers of DevOps - DevOpsDays Boston 2017Settlers of DevOps - DevOpsDays Boston 2017
Settlers of DevOps - DevOpsDays Boston 2017Rob Cummings
 
The Changing Role of IT: From Service Managers to Advisors
The Changing Role of IT:From Service Managers to AdvisorsThe Changing Role of IT:From Service Managers to Advisors
The Changing Role of IT: From Service Managers to AdvisorsJesse Stockall
 

Similar to Les microservices, c'est pas automatique ! - Linkvalue Tech (20)

Common Anti-patterns that Impede a Successful Digital Transformation
Common Anti-patterns that Impede a Successful Digital TransformationCommon Anti-patterns that Impede a Successful Digital Transformation
Common Anti-patterns that Impede a Successful Digital Transformation
 
Building DevOps in the Enterprise: Balancing Centralized and Decentralized Teams
Building DevOps in the Enterprise: Balancing Centralized and Decentralized TeamsBuilding DevOps in the Enterprise: Balancing Centralized and Decentralized Teams
Building DevOps in the Enterprise: Balancing Centralized and Decentralized Teams
 
Clone Clone Make: a better way to build
Clone Clone Make: a better way to buildClone Clone Make: a better way to build
Clone Clone Make: a better way to build
 
External should that be a microservice
External should that be a microserviceExternal should that be a microservice
External should that be a microservice
 
First Caracas MuleSoft Meetup Slides
First Caracas MuleSoft Meetup SlidesFirst Caracas MuleSoft Meetup Slides
First Caracas MuleSoft Meetup Slides
 
David Leslie - Testing at MACH Speed.pptx
David Leslie - Testing at MACH Speed.pptxDavid Leslie - Testing at MACH Speed.pptx
David Leslie - Testing at MACH Speed.pptx
 
Sea spin5 2013-notes
Sea spin5 2013-notesSea spin5 2013-notes
Sea spin5 2013-notes
 
Making microservices work
Making microservices workMaking microservices work
Making microservices work
 
Multi-Agency Multi-Media Interoperable Communication, Enabled By Redis: Paul ...
Multi-Agency Multi-Media Interoperable Communication, Enabled By Redis: Paul ...Multi-Agency Multi-Media Interoperable Communication, Enabled By Redis: Paul ...
Multi-Agency Multi-Media Interoperable Communication, Enabled By Redis: Paul ...
 
Let's talk about Coded Automation
Let's talk about Coded AutomationLet's talk about Coded Automation
Let's talk about Coded Automation
 
Continuously Delivering Distributed Systems
Continuously Delivering Distributed SystemsContinuously Delivering Distributed Systems
Continuously Delivering Distributed Systems
 
Growing as a software craftsperson (part 1) From Pune Software Craftsmanship.
Growing as a software craftsperson (part 1)  From Pune Software Craftsmanship.Growing as a software craftsperson (part 1)  From Pune Software Craftsmanship.
Growing as a software craftsperson (part 1) From Pune Software Craftsmanship.
 
Lean Software Development & Kanban
Lean Software Development & KanbanLean Software Development & Kanban
Lean Software Development & Kanban
 
Microservices: Why and When? - Alon Fliess, CodeValue - Cloud Native Day Tel ...
Microservices: Why and When? - Alon Fliess, CodeValue - Cloud Native Day Tel ...Microservices: Why and When? - Alon Fliess, CodeValue - Cloud Native Day Tel ...
Microservices: Why and When? - Alon Fliess, CodeValue - Cloud Native Day Tel ...
 
Novel_Value_Stream_Analysis_for_SAFe_-_ver_8.pdf
Novel_Value_Stream_Analysis_for_SAFe_-_ver_8.pdfNovel_Value_Stream_Analysis_for_SAFe_-_ver_8.pdf
Novel_Value_Stream_Analysis_for_SAFe_-_ver_8.pdf
 
Measuring Performance: See the Science of DevOps Measurement in Action
Measuring Performance: See the Science of DevOps Measurement in ActionMeasuring Performance: See the Science of DevOps Measurement in Action
Measuring Performance: See the Science of DevOps Measurement in Action
 
Improve existing code with confidence, supported by unit tests
Improve existing code with confidence, supported by unit testsImprove existing code with confidence, supported by unit tests
Improve existing code with confidence, supported by unit tests
 
Meetup slide 20_apr
Meetup slide 20_aprMeetup slide 20_apr
Meetup slide 20_apr
 
Settlers of DevOps - DevOpsDays Boston 2017
Settlers of DevOps - DevOpsDays Boston 2017Settlers of DevOps - DevOpsDays Boston 2017
Settlers of DevOps - DevOpsDays Boston 2017
 
The Changing Role of IT: From Service Managers to Advisors
The Changing Role of IT:From Service Managers to AdvisorsThe Changing Role of IT:From Service Managers to Advisors
The Changing Role of IT: From Service Managers to Advisors
 

Recently uploaded

Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILNatan Silnitsky
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageGlobus
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...Juraj Vysvader
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesKrzysztofKkol1
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?XfilesPro
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEJelle | Nordend
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfOrtus Solutions, Corp
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Anthony Dahanne
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfkalichargn70th171
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyanic lab
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsGlobus
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of ProgrammingMatt Welsh
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...informapgpstrackings
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Globus
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesGlobus
 

Recently uploaded (20)

Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 

Les microservices, c'est pas automatique ! - Linkvalue Tech

  • 2. JEAN-MARIE LAMODIERE Build microservices since 07/2015 @JMLamodiere LES MICROSERVICES, C'EST PAS AUTOMATIQUE ! Linkvalue | Jean-Marie Lamodière 2 Microservices? Think twice! 1935 CP
  • 3. Linkvalue | Jean-Marie Lamodière ASHAMED OF YOUR MONOLITH?  Spaghetti code  Side effects  Team velocity decreasing  Hard to refactor  Bugs 3
  • 4. Linkvalue | Jean-Marie Lamodière 4
  • 5. Linkvalue | Jean-Marie Lamodière 5
  • 6. Linkvalue | Jean-Marie Lamodière PROBLEMS THEY SOLVE 1.Autonomy 2.Autonomy 3.Autonomy 6
  • 7. Linkvalue | Jean-Marie Lamodière PROBLEMS THEY SOLVE 1.Autonomy : deployment 2.Autonomy : langage, framework 3.Autonomy : scalability 7
  • 8. Linkvalue | Jean-Marie Lamodière 8
  • 9. Linkvalue | Jean-Marie Lamodière WHY AUTONOMY MATTERS?  Loosely coupled organisation = less coupled systems  Quality audit on windows vista : organizational structures = most important factor!  Team accountability 9
  • 10. Linkvalue | Jean-Marie Lamodière OTHER KEY BENEFITS  Easier for newcomers  Allows isolated POC  Teams scalability  Simpler code design  Easy refactoring 10
  • 11. Linkvalue | Jean-Marie Lamodière WHO USES IT?  Uber  Netflix  Amazon  Ebay  Sound Cloud  Groupon 11  Guilt  Zalando  Spotify  Meetic  M6 Web  Auchan
  • 12. Linkvalue | Jean-Marie Lamodière « Trade-offs » appears 24x in « Building Microservices » book 12
  • 13. Linkvalue | Jean-Marie Lamodière 13
  • 14. Linkvalue | Jean-Marie Lamodière TESTIMONY (45' talks published on )  « We had to fall back to a monolith, and retry when ready » – SAMUEL ROZE PHP Tour 2016 • Prenons soin de nos microservices  « I wish I had known... » – MATT RANNEY GOTO 2016 • What I Wish I Had Known Before Scaling Uber to 1000 Services 14
  • 15. Linkvalue | Jean-Marie Lamodière 15
  • 16. Linkvalue | Jean-Marie Lamodière WHAT IS SO COMPLEX ?  Boundaries : hard to find / change  Huuuge dev-ops stack  Distributed system  Failure handling  Monitoring  End-to-end testing 16
  • 17. Linkvalue | Jean-Marie Lamodière 17
  • 18. Linkvalue | Jean-Marie Lamodière BOUNDARIES : WHERE TO SPLIT?  Splitting = hard to change  Size ? Small enough, not smaller  Splitting by technical layers? no!  Things that should change together (« S » in S.O.L.I.D.)  Loose coupling, high cohesion 18
  • 19. Linkvalue | Jean-Marie Lamodière DDD* TO THE RESCUE! (* Domain Driven Design) Toolset to help domain experts and developers to refine and share domain knowledge, reflect it in the code base, and prioritize efforts. 19
  • 20. Linkvalue | Jean-Marie Lamodière MAKE THE IMPLICIT, EXPLICIT! 20 Copyright @DDDreboot ;)
  • 21. Linkvalue | Jean-Marie Lamodière SPLIT BY BOUNDED CONTEXT  Bounded context = Team sharing the same « ubiquitous language » (same terms)  Vertical, business-focus slice 21
  • 22. Linkvalue | Jean-Marie Lamodière WHEN TO SPLIT ?  When ready : technical stack chosen, architectural decisions taken, devs and ops willing to go, autonomous 2 pizza feature teams  When sure of a splitting point  Start with a monolith (!) to find them 22
  • 23. Linkvalue | Jean-Marie Lamodière CONWAY'S LAW « Organizations which design systems are constrained to produce designs which are copies of the communication structures of these organizations » 23
  • 24. Linkvalue | Jean-Marie Lamodière 2ND LAW OF CONSULTING (Gerald Weinberg) 24
  • 25. Linkvalue | Jean-Marie Lamodière SPLITTING STRATEGY  Implement double-writing (microservice or legacy side)  Publish needed messages  One-shot data import script  Assert data is sync  Read from microservice 25
  • 26. Linkvalue | Jean-Marie Lamodière COMMUNICATION BETWEEN µS  No shared database!  Language agnostic (ex : rest / json)  If weakly typed (json), have a clear doc (optional? nullable?) or json-schema  Keep consistency. ex : pagination  Define minimal customer-centric api 26
  • 27. Linkvalue | Jean-Marie Lamodière COMMUNICATION BETWEEN µS 27
  • 28. Linkvalue | Jean-Marie Lamodière 28
  • 29. Linkvalue | Jean-Marie Lamodière SYNCHRONOUS COMMUNICATION - PROS -  Easier to understand (= method call)  Easier transition from monolith  Instant feedback to the client 29
  • 30. Linkvalue | Jean-Marie Lamodière SYNCHRONOUS COMMUNICATION 3030 User Optin Other service depending on 1 optin Register Register french user Read 1 optin Read
  • 31. Linkvalue | Jean-Marie Lamodière SYNCHRONOUS COMMUNICATION - CONS -  Fanout : 1% slow calls more probable when cascading calls  Beware of coupling !  Beware of distributed monolith !! 31
  • 33. Linkvalue | Jean-Marie Lamodière ASYNCHRONOUS COMMUNICATION  Message broker  Reactive : event driven  Choregraphy over orchestration  Autonomy over authority : each service copy the data it needs  Work well with CQRS / ES 33
  • 34. Linkvalue | Jean-Marie Lamodière ASYNCHRONOUS COMMUNICATION 34 Message brokerMessage broker Message brokerMessage broker User French user registered Optin User optins changed Other service depending on 1 optin Register Read
  • 35. Linkvalue | Jean-Marie Lamodière COMMUNICATION TRAPS  Chatty communication = coupling feature envy, wrong splitting…  Perf overhead : define « acceptable » 35
  • 36. Linkvalue | Jean-Marie Lamodière 36
  • 37. Linkvalue | Jean-Marie Lamodière DESIGN FOR FAILURE  It will fail, have a plan!  Define what to do, to return  Define timeout for each call  Message hospital (dead letter queue)  Circuit breaker / back pressure  Blameless culture needed 37
  • 38. Linkvalue | Jean-Marie Lamodière NETFLIX CHAOS MONKEY  Randomly shut down services  Cure developers optimism ;) 38
  • 39. Linkvalue | Jean-Marie Lamodière SERVICE DISCOVERY  Each µs scales individualy : which IP should we call ?  DNS in front of a load-balancer  Kubernetes services  Docker Swarm discovery (libkv + consul/etcd/zookeeper) 39
  • 40. Linkvalue | Jean-Marie Lamodière CAP THEOREM (Distributed Systems)  Choose 2 between consistency (C), availability (A) and partition (P)  Avoid distributed transactions  Embrase eventual consistency  Use idempotent operations  Worker to clean inconsistency 40
  • 41. Linkvalue | Jean-Marie Lamodière 41
  • 42. Linkvalue | Jean-Marie Lamodière MICROSERVICES CLIENTS  Libraries ok, 1 per language needed  No business logic in client : avoid anemic CRUD microservices  To call a complex api (legacy, external), build a facade service 42
  • 43. Linkvalue | Jean-Marie Lamodière CHANGE PROOF CLIENTS  Old and new api should cohexist  Postel's law : « be conservative in what you do, be liberal in what you accept from others »  Tolerant reader (Martin Fowler) : ignore changes not impacting you 43
  • 44. Linkvalue | Jean-Marie Lamodière CHANGE PROOF CLIENTS 44
  • 45. Linkvalue | Jean-Marie Lamodière API GATEWAY  Avoid exposing µs to frontend  Hide spliting to new microservices  Handle authentication / roles  Pro-tips : Back-end for frontend, 1 gateway per front application 45
  • 46. Linkvalue | Jean-Marie Lamodière API GATEWAY 46 Microservice Legacy Monolith Microservice Microservice Android API Gateway Android application Public Private ReactJS Web application ReactJS API Gateway
  • 47. Linkvalue | Jean-Marie Lamodière 47
  • 48. Linkvalue | Jean-Marie Lamodière TESTING A MICROSERVICE  No end-to-end testing at µs level  Stub/mock others µs in functional tests  Have consumer-driven tests  No continuous integration = no µs!  One c.i. pipeline per microservice 48
  • 49. Linkvalue | Jean-Marie Lamodière END TO END TESTING  Test journeys (main features), not user stories (already tested)  Goal : check wiring  Should be done in each front app  Can run in production 49
  • 50. Linkvalue | Jean-Marie Lamodière TESTING = TRUST 50 Involve a quality assurance member in your feature team
  • 51. Linkvalue | Jean-Marie Lamodière ARCHITECT ROLE  Keep µs map up to date  Define communication between µs  Define automatic deploying, monitoring and logging strategy  Adapt to change, like a city planner  Enforce team autonomy inside a µs 51
  • 52. Linkvalue | Jean-Marie Lamodière 52
  • 53. Linkvalue | Jean-Marie Lamodière WHAT SHOULD µS KEEP COMMON ?  Rules : communication, logs...  Template to create new µs, but no synchronization afterward  Violate DRY accross µs !  Shared code = coupling  Priority : autonomy 53
  • 54. Linkvalue | Jean-Marie Lamodière MONITORING / LOGGING TIPS  Pass a unique « correlation id » to each sub-calls, including messages and asynchronous calls  Make sure your APM supports each language + versions  Have a look at Sysdig.org 54
  • 55. Linkvalue | Jean-Marie Lamodière 55  Extreme Programming  TDD / BDD  S.O.L.I.D.  Loose coupling, high cohesion  DDD  Hexagonal
  • 56. Linkvalue | Jean-Marie Lamodière BEFORE YOU START  microservices.io  martinfowler.com /microservices/ /articles/microservices.html /articles/microservice-trade-offs.html  groups.google.com /forum/#!forum/microservices 56
  • 57. Linkvalue | Jean-Marie Lamodière ASYNCHRONOUS COMMUNICATION  blog.christianposta.com Why Microservices Should Be Event Driven:Autonomy vs Authority  reactivemanifesto.org 57 Lightbend.com (free)
  • 58. Linkvalue | Jean-Marie Lamodière TALKS  What I Wish I Had Known Before Scaling Uber to 1000 Services GOTO 2016 • Matt Ranney  Prenons soin de nos microservices PHP Tour 2016 • SAMUEL ROZE  Meetic backend mutation with Symfony SymfonyLive 2015 • J. Calabrese E. Broutin  Kafka event architecture at Meetic Forum PHP 2015 • B. Pineau M. Robin 58
  • 59. Linkvalue | Jean-Marie Lamodière DDD RECOMMENDED BOOKS 59 leanpub.com (free)
  • 60. Thank you! Linkvalue | Jean-Marie Lamodière 60 Committed to innovate LINKVALUE JEAN-MARIE LAMODIERE Build microservices since 07/2015 @JMLamodiere 1935 CP