SlideShare une entreprise Scribd logo
1  sur  46
Télécharger pour lire hors ligne
Retour d’expérience
Architecture MicroService chez BotsUnit
Grégoire Lejeune - Developper & Architect
Mikael Robert - Devops & Infrastructure Architect
Plan
I Le microservice c’est quoi ?
II Promesses et difficultés
III Notre histoire avec le microservice
IV Retour d’expérience
I - Le microservice ?
L’âge de pierre
monolithe SQL
L’âge de cuivre
monolithe SQL
L’âge de bronze
composant
composant
composant
composant
composant
composant
composant
L’age de fer
service
service
service
service
service
service
service
La littérature
approach to developing a single
application as a suite of small services,
each running in its own process and
communicating with lightweight
mechanisms, often an HTTP resource
API. These services are built around
business capabilities and
independently deployable by fully
automated deployment machinery.
There is a bare minimum of centralized
management of these services, which
may be written in different
programming languages and use
different data storage technologies.
-- Fowler & Lewis
user identity billing
shopmail
shop Store
API
II - Promesses et difficultés
Isolation /
Interdépendance
monolithe
Bank
User
Shop
Isolation /
Interdépendance
Changer un élément implique de le
changer partout, de revoir les tests
partout et de redéployer l’ensemble.
monolithe
Bank
User
Shop
Isolation /
Interdépendance
Changer un élément implique de le
changer à un seul endroit, de modifier
les tests à un seul endroit et de ne
redéployer que le MS modifié.
Shop
Bank
User
Table
Scalabilité
Que ce qui est nécessaire
...
billing
...
...
shop
...
...
billing
shop
shop
Store
Store
Store
Store
Store
Store
Store
2 core
4 GB
2 core
4 GB
2 core
4 GB
4 core
8 GB
4 core
8 GB
Scalabilité
Tout ou rien monolithe
monolithe
monolithe SQL
8 core
32 GB
8 core
32 GB
8 core
32 GB
8 core
128 GB
Défaillance
L’ensemble est compromis
monolithe SQL
Défaillance
Seul un élément est compromis.
Design for failure
...
...
...
...
...
...
...
Store
Store
Store
Store
Store
Store
Store
Défaillance
Seul un élément est compromis.
Design for failure
...
...
...
...
...
...
...
Store
Store
Store
Store
Store
Store
Store
Polyglotte
User
Bank
Chat
Front
Difficultés
Mise en place d’un mécanisme
inter-services.
Problème de transaction distribuées
Complexité des tests
...
... ...
...
...
...
...
......
...
...
...
Difficultés
Développement d’un Framework
autour de Kafka (Event based).
Message ∈ Transaction
Kafka
... ... ... ... ... ...
... ... ... ... ... ...
Difficultés
Déploiement
Utilisation des ressources physiques
.erl
.ex ...
Store
...
1
4
3
Kafka
2
So...
● Scaling Micro et non Macro
● Découpage
● Multi Langage / Polyglotte
● Un MS = Une micro équipe
● Eviter perte de contrôle du monolithe
● Tirer parti des avantages des différents
hébergeurs
● Dizaines d’applications
○ Déploiement
○ Release management
● Énormément de machines à gérer
● REST/HTTP vs BUS
● Front
● Transactionnel
● Déporter la charge sur le réseau
(+) (-)
III Notre histoire
Une startup
Fintech
1) Monolithe
HTML
JS
CSS
Rails
Store
Monolithe
Une startup
Fintech
1) Monolithe
2) SOA
HTML
JS
CSS
Rails
Store
Monolithe
API
Front
HTML
JS
CSS
Rails
Store
Une startup
Fintech
1) Monolithe
2) SOA
3) MicroServices
HTML
JS
CSS
Rails
Store
Monolithe
Store
API
Front
HTML
JS
CSS
Rails
Kafka
API
Front
Mail Gen File Virement
ErlangErlangErlang
Store
Notre propre Startup
● Convaincus par le MS suite au REX
On monte notre boîte !
● Le Projet initial :
○ Plateforme à la Heroku mais orienté
MicroServices
○ Framework microservices / kafka
○ Infra / DB / Middlewares on Demand
Objectifs initiaux
● Très haute volumétrie (plusieurs M / jours)
● Prouver notre capacité à encaisser
● Tolérance à la panne, auto-guérison
● Coûts raisonnables pour ces objectifs
Equipe
● Un investisseur / Directeur commercial.
● Un architecte d’applications Web de plus de 10 ans XP (MS et Streaming)
● Un CTO, 10 ans d’Erlang, Outils Cloud (Vidal, eNovance, Fintech).
● Un architecte d’infrastructure / devops, 8 ans XP (OCTO Technology,
Startup Fintech)
Erlang Elixir GCE Consul ChefDockerKafka
Expérimenter la plateforme
Démarrer : framework kafka + infra on demand avec des MS “tests”
Conclusion rapide : On ne prouvait pas vraiment prouver notre efficacité avec
des cas d’école, il fallait développer la plateforme avec un vrai projet
Besoin : Prouver nos idées et la pertinence de nos outils
Idée :
Plateforme de streaming vidéo live/chat intéractive
Principes de bases
● Framework Kafka, protocole et format de message commun
● Event based
● Duplication de donnée en local (cache) pour éviter de ré-appeler
Kafka
User Payment ChatStore Store
From: User
Payer : 1000
Recipient : 1001
Amount: 10
From: Payment
Payer : 1000
Recipient : 1001
Amount: 10
Tip
Notify
Le premier micro service … le front
Kafka
...
Store
front
Store
StandBy
front
API API
Puis un deuxième : User
Kafka
... ...
Store
user
Store
StandBy
user
API API
Puis un troisième : Identity
Kafka
... ...
Store
identity
Store
StandBy
Identity
API API
...
Puis on en a rapidement 8, 10, 12 ... :
front, user, identity, payment, broadcast, chat, realtime, shop..
Kafka
... ... ... ... ... ...
... ... ... ... ... ...
Notre retour d’expérience
Douleurs & solutions
Aujourd’hui : nos avantages
● Le produit fonctionne bien, il est prêt à être lancé :)
● Tolérance à la panne : Quand un service plante, on ne perd pas tout le site
● Mise à jour service par service (voir aussi le point précédent)
● Asynchrone - traitement de masse
● Scaling des composants indépendant
● Optimisation indépendante : en optimisant un service, on ne risque pas
d’effets de bords sur un autre
● On pourrait sous traiter le développement de micro services
Aujourd’hui : nos douleurs
1. Trop de machines
a. Cela coûte cher ...
b. Même notre prototype opérationnel Kubernetes en souffre, difficile à stabiliser
2. Trop de bases de données
a. Extrêmement difficile en exploitation
b. Consistance difficile à assurer
3. Des microservices devenu des mini monolithes
4. Deux sources de vérité pour les données : Kafka et les BDD
5. Le front est devenu un plat de spaghettis
1. Trop de machines
● Plus simple de debugger dans une VM que dans un container
● Etape 1 : Travail pour réduire la consommation en idle (polling kafka et BDDs)
● Etape 1.5 : Optimisation qui n’ont pas pu être faites à cause de la pression des
features
● Etape 2 : Diminuer le nombre de serveurs de base de données
● Etape 3 : Tout mettre dans Kubernetes
2. Trop de base de données
● Golden Hammer : on sait faire avec Postgres on met Postgres partout
○ Très loin d’être adapté à tous les cas
○ Scale mal
● Pistes étudiées actuellement :
○ 1 cluster Postgres, 1 cluster Redis et 1 cluster Cassandra, le tout en commun
○ Bascule vers Redis plein de data qui sont uniquement temporaires ou du cache
○ Passer de N bases à M bases (mutualiser certaines bases entre des microservices)
3. Des microservices devenu des mini
monolithes
Payment
Encheres
Tipping
Achat
Ventes
Enchères Tipping
VentesAchats
4. Deux sources de vérités pour les données
● Les données arrivent par Kafka, mais sont aussi stockées en base.
○ Qui a raison en cas de conflit? De duplicata ?
● Très conflictuel quand on a un soucis, on ne sait jamais trop quelle source
prendre
● Kafka pour la reprise sur erreur
○ Parfaitement adapté
● Le cluster cassandra commun pourrait être une solution
○ Scalable
○ Haute performance
5. Le front plat de spaghettis
● Front V2, refonte complète
○ On voudrait faire une SPA, mais toujours problème de SEO
○ Mettre le CSS et le JS dans un seul microservice et pas dans tous, partie par partie évitera pas
mal de soucis et permettra la réutilisation
● Avantages :
○ On ne multiplie plus les endroits pour modifier le front
● Inconvénients :
○ On risque de devoir mettre à jour ce service chaque fois qu’un autre évolue
Monolithe vs Microservices :
Design for Failure : l’architecture idéale (selon nous)
Shop PaymentUserChat
SPA:
HTML
JS
CSS
CDN
SPA:
HTML/CSS/JS
Monolithe vs Microservices :
Design for Failure : l’architecture idéale (selon nous)
Shop PaymentUserChat
SPA:
HTML
JS
CSS
CDN
SPA:
HTML/CSS/JS
Nos conseils
● Evitez de courir deux chevaux à la fois.
○ Équipe d’experts et pattern maîtrisés.
○ R&D
● Pas de pattern leader.
● Faire un choix et s’y tenir.
● Éviter les effets de mode.
Le micro service est sans hésiter l’avenir de l’architecture IT
Questions ?
Q & A
gregoire.lejeune@botsunit.com
@glejeune
/glejeune
mikael.robert@botsunit.com
@mikaelrob
/mikrob /botsunit

Contenu connexe

Tendances

CWIN17 Morocco / Microservices architecture ghofrane benaziz
CWIN17 Morocco / Microservices architecture ghofrane benazizCWIN17 Morocco / Microservices architecture ghofrane benaziz
CWIN17 Morocco / Microservices architecture ghofrane benazizCapgemini
 
Resilience4j with Spring Boot
Resilience4j with Spring BootResilience4j with Spring Boot
Resilience4j with Spring BootKnoldus Inc.
 
Flink Forward San Francisco 2018: Andrew Gao & Jeff Sharpe - "Finding Bad Ac...
Flink Forward San Francisco 2018: Andrew Gao &  Jeff Sharpe - "Finding Bad Ac...Flink Forward San Francisco 2018: Andrew Gao &  Jeff Sharpe - "Finding Bad Ac...
Flink Forward San Francisco 2018: Andrew Gao & Jeff Sharpe - "Finding Bad Ac...Flink Forward
 
Monitoring Apache Kafka
Monitoring Apache KafkaMonitoring Apache Kafka
Monitoring Apache Kafkaconfluent
 
MicroService Architecture
MicroService ArchitectureMicroService Architecture
MicroService ArchitectureFred George
 
Scalable Filesystem Metadata Services with RocksDB
Scalable Filesystem Metadata Services with RocksDBScalable Filesystem Metadata Services with RocksDB
Scalable Filesystem Metadata Services with RocksDBAlluxio, Inc.
 
Enterprise Software Architecture styles
Enterprise Software Architecture stylesEnterprise Software Architecture styles
Enterprise Software Architecture stylesAraf Karsh Hamid
 
Microservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and SagaMicroservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and SagaAraf Karsh Hamid
 
BigData_Chp3: Data Processing
BigData_Chp3: Data ProcessingBigData_Chp3: Data Processing
BigData_Chp3: Data ProcessingLilia Sfaxi
 
Database migration from Sybase ASE to PostgreSQL @2013.pgconf.eu
Database migration from Sybase ASE to PostgreSQL @2013.pgconf.euDatabase migration from Sybase ASE to PostgreSQL @2013.pgconf.eu
Database migration from Sybase ASE to PostgreSQL @2013.pgconf.eualdaschwede80
 
Understand your system like never before with OpenTelemetry, Grafana, and Pro...
Understand your system like never before with OpenTelemetry, Grafana, and Pro...Understand your system like never before with OpenTelemetry, Grafana, and Pro...
Understand your system like never before with OpenTelemetry, Grafana, and Pro...LibbySchulze
 
Performance Engineering Masterclass: Efficient Automation with the Help of SR...
Performance Engineering Masterclass: Efficient Automation with the Help of SR...Performance Engineering Masterclass: Efficient Automation with the Help of SR...
Performance Engineering Masterclass: Efficient Automation with the Help of SR...ScyllaDB
 
BigData_Chp5: Putting it all together
BigData_Chp5: Putting it all togetherBigData_Chp5: Putting it all together
BigData_Chp5: Putting it all togetherLilia Sfaxi
 
Rapport exposé eXtreme Programming XP
Rapport exposé eXtreme Programming XPRapport exposé eXtreme Programming XP
Rapport exposé eXtreme Programming XPSarah
 
Introduction au Domain Driven Design
Introduction au Domain Driven DesignIntroduction au Domain Driven Design
Introduction au Domain Driven DesignDNG Consulting
 
MariaDB Xpand 고객사례 안내.pdf
MariaDB Xpand 고객사례 안내.pdfMariaDB Xpand 고객사례 안내.pdf
MariaDB Xpand 고객사례 안내.pdfssusercbaa33
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesAraf Karsh Hamid
 
Comment utiliser JIRA pour mon équipe, mon entreprise ? Comment me renseigner ?
Comment utiliser JIRA pour mon équipe, mon entreprise ? Comment me renseigner ?Comment utiliser JIRA pour mon équipe, mon entreprise ? Comment me renseigner ?
Comment utiliser JIRA pour mon équipe, mon entreprise ? Comment me renseigner ?DC CONSULTANTS
 

Tendances (20)

CWIN17 Morocco / Microservices architecture ghofrane benaziz
CWIN17 Morocco / Microservices architecture ghofrane benazizCWIN17 Morocco / Microservices architecture ghofrane benaziz
CWIN17 Morocco / Microservices architecture ghofrane benaziz
 
Patterns of resilience
Patterns of resiliencePatterns of resilience
Patterns of resilience
 
Resilience4j with Spring Boot
Resilience4j with Spring BootResilience4j with Spring Boot
Resilience4j with Spring Boot
 
Flink Forward San Francisco 2018: Andrew Gao & Jeff Sharpe - "Finding Bad Ac...
Flink Forward San Francisco 2018: Andrew Gao &  Jeff Sharpe - "Finding Bad Ac...Flink Forward San Francisco 2018: Andrew Gao &  Jeff Sharpe - "Finding Bad Ac...
Flink Forward San Francisco 2018: Andrew Gao & Jeff Sharpe - "Finding Bad Ac...
 
Monitoring Apache Kafka
Monitoring Apache KafkaMonitoring Apache Kafka
Monitoring Apache Kafka
 
MicroService Architecture
MicroService ArchitectureMicroService Architecture
MicroService Architecture
 
Scalable Filesystem Metadata Services with RocksDB
Scalable Filesystem Metadata Services with RocksDBScalable Filesystem Metadata Services with RocksDB
Scalable Filesystem Metadata Services with RocksDB
 
Enterprise Software Architecture styles
Enterprise Software Architecture stylesEnterprise Software Architecture styles
Enterprise Software Architecture styles
 
Microservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and SagaMicroservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and Saga
 
BigData_Chp3: Data Processing
BigData_Chp3: Data ProcessingBigData_Chp3: Data Processing
BigData_Chp3: Data Processing
 
Database migration from Sybase ASE to PostgreSQL @2013.pgconf.eu
Database migration from Sybase ASE to PostgreSQL @2013.pgconf.euDatabase migration from Sybase ASE to PostgreSQL @2013.pgconf.eu
Database migration from Sybase ASE to PostgreSQL @2013.pgconf.eu
 
Understand your system like never before with OpenTelemetry, Grafana, and Pro...
Understand your system like never before with OpenTelemetry, Grafana, and Pro...Understand your system like never before with OpenTelemetry, Grafana, and Pro...
Understand your system like never before with OpenTelemetry, Grafana, and Pro...
 
Performance Engineering Masterclass: Efficient Automation with the Help of SR...
Performance Engineering Masterclass: Efficient Automation with the Help of SR...Performance Engineering Masterclass: Efficient Automation with the Help of SR...
Performance Engineering Masterclass: Efficient Automation with the Help of SR...
 
BigData_Chp5: Putting it all together
BigData_Chp5: Putting it all togetherBigData_Chp5: Putting it all together
BigData_Chp5: Putting it all together
 
Rapport exposé eXtreme Programming XP
Rapport exposé eXtreme Programming XPRapport exposé eXtreme Programming XP
Rapport exposé eXtreme Programming XP
 
Introduction au Domain Driven Design
Introduction au Domain Driven DesignIntroduction au Domain Driven Design
Introduction au Domain Driven Design
 
MariaDB Xpand 고객사례 안내.pdf
MariaDB Xpand 고객사례 안내.pdfMariaDB Xpand 고객사례 안내.pdf
MariaDB Xpand 고객사례 안내.pdf
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing Strategies
 
Observability driven development
Observability driven developmentObservability driven development
Observability driven development
 
Comment utiliser JIRA pour mon équipe, mon entreprise ? Comment me renseigner ?
Comment utiliser JIRA pour mon équipe, mon entreprise ? Comment me renseigner ?Comment utiliser JIRA pour mon équipe, mon entreprise ? Comment me renseigner ?
Comment utiliser JIRA pour mon équipe, mon entreprise ? Comment me renseigner ?
 

En vedette

Tracxn Research - Finance & Accounting Landscape, February 2017
Tracxn Research - Finance & Accounting Landscape, February 2017Tracxn Research - Finance & Accounting Landscape, February 2017
Tracxn Research - Finance & Accounting Landscape, February 2017Tracxn
 
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...Lucas Jellema
 
Introduction to Amazon Relational Database Service
Introduction to Amazon Relational Database ServiceIntroduction to Amazon Relational Database Service
Introduction to Amazon Relational Database ServiceAmazon Web Services
 
MongoDB NoSQL database a deep dive -MyWhitePaper
MongoDB  NoSQL database a deep dive -MyWhitePaperMongoDB  NoSQL database a deep dive -MyWhitePaper
MongoDB NoSQL database a deep dive -MyWhitePaperRajesh Kumar
 
Tracxn Research - Industrial Robotics Landscape, February 2017
Tracxn Research - Industrial Robotics Landscape, February 2017Tracxn Research - Industrial Robotics Landscape, February 2017
Tracxn Research - Industrial Robotics Landscape, February 2017Tracxn
 
Tugas4 1412510602 dewi_apriliani
Tugas4 1412510602 dewi_aprilianiTugas4 1412510602 dewi_apriliani
Tugas4 1412510602 dewi_aprilianidewiapril1996
 
Webinar - Bringing Game Changing Insights with Graph Databases
Webinar - Bringing Game Changing Insights with Graph DatabasesWebinar - Bringing Game Changing Insights with Graph Databases
Webinar - Bringing Game Changing Insights with Graph DatabasesDataStax
 
Tracxn Research - Healthcare Analytics Landscape, February 2017
Tracxn Research - Healthcare Analytics Landscape, February 2017Tracxn Research - Healthcare Analytics Landscape, February 2017
Tracxn Research - Healthcare Analytics Landscape, February 2017Tracxn
 
Tracxn Research - Mobile Advertising Landscape, February 2017
Tracxn Research - Mobile Advertising Landscape, February 2017Tracxn Research - Mobile Advertising Landscape, February 2017
Tracxn Research - Mobile Advertising Landscape, February 2017Tracxn
 
DATA SCIENCE IS CATALYZING BUSINESS AND INNOVATION
DATA SCIENCE IS CATALYZING BUSINESS AND INNOVATION DATA SCIENCE IS CATALYZING BUSINESS AND INNOVATION
DATA SCIENCE IS CATALYZING BUSINESS AND INNOVATION Elvis Muyanja
 
Tugas 2 – 0317 (individu)
Tugas 2 – 0317 (individu)Tugas 2 – 0317 (individu)
Tugas 2 – 0317 (individu)Linda Lestari
 
Anais Escola Regional de Banco de Dados ERBD 2016
Anais Escola Regional de Banco de Dados ERBD 2016Anais Escola Regional de Banco de Dados ERBD 2016
Anais Escola Regional de Banco de Dados ERBD 2016Juan José Rodriguez MsC.
 
Regulating corporate vc
Regulating corporate vcRegulating corporate vc
Regulating corporate vcIan Beckett
 
Focus on Your Analysis, Not Your SQL Code
Focus on Your Analysis, Not Your SQL CodeFocus on Your Analysis, Not Your SQL Code
Focus on Your Analysis, Not Your SQL CodeDATAVERSITY
 

En vedette (16)

Tracxn Research - Finance & Accounting Landscape, February 2017
Tracxn Research - Finance & Accounting Landscape, February 2017Tracxn Research - Finance & Accounting Landscape, February 2017
Tracxn Research - Finance & Accounting Landscape, February 2017
 
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
 
Introduction to Amazon Relational Database Service
Introduction to Amazon Relational Database ServiceIntroduction to Amazon Relational Database Service
Introduction to Amazon Relational Database Service
 
MongoDB NoSQL database a deep dive -MyWhitePaper
MongoDB  NoSQL database a deep dive -MyWhitePaperMongoDB  NoSQL database a deep dive -MyWhitePaper
MongoDB NoSQL database a deep dive -MyWhitePaper
 
Tracxn Research - Industrial Robotics Landscape, February 2017
Tracxn Research - Industrial Robotics Landscape, February 2017Tracxn Research - Industrial Robotics Landscape, February 2017
Tracxn Research - Industrial Robotics Landscape, February 2017
 
Tugas4 1412510602 dewi_apriliani
Tugas4 1412510602 dewi_aprilianiTugas4 1412510602 dewi_apriliani
Tugas4 1412510602 dewi_apriliani
 
Webinar - Bringing Game Changing Insights with Graph Databases
Webinar - Bringing Game Changing Insights with Graph DatabasesWebinar - Bringing Game Changing Insights with Graph Databases
Webinar - Bringing Game Changing Insights with Graph Databases
 
Tracxn Research - Healthcare Analytics Landscape, February 2017
Tracxn Research - Healthcare Analytics Landscape, February 2017Tracxn Research - Healthcare Analytics Landscape, February 2017
Tracxn Research - Healthcare Analytics Landscape, February 2017
 
Tracxn Research - Mobile Advertising Landscape, February 2017
Tracxn Research - Mobile Advertising Landscape, February 2017Tracxn Research - Mobile Advertising Landscape, February 2017
Tracxn Research - Mobile Advertising Landscape, February 2017
 
DATA SCIENCE IS CATALYZING BUSINESS AND INNOVATION
DATA SCIENCE IS CATALYZING BUSINESS AND INNOVATION DATA SCIENCE IS CATALYZING BUSINESS AND INNOVATION
DATA SCIENCE IS CATALYZING BUSINESS AND INNOVATION
 
Tugas 2 – 0317 (individu)
Tugas 2 – 0317 (individu)Tugas 2 – 0317 (individu)
Tugas 2 – 0317 (individu)
 
Anais Escola Regional de Banco de Dados ERBD 2016
Anais Escola Regional de Banco de Dados ERBD 2016Anais Escola Regional de Banco de Dados ERBD 2016
Anais Escola Regional de Banco de Dados ERBD 2016
 
Regulating corporate vc
Regulating corporate vcRegulating corporate vc
Regulating corporate vc
 
Mysql introduction
Mysql introduction Mysql introduction
Mysql introduction
 
CV
CVCV
CV
 
Focus on Your Analysis, Not Your SQL Code
Focus on Your Analysis, Not Your SQL CodeFocus on Your Analysis, Not Your SQL Code
Focus on Your Analysis, Not Your SQL Code
 

Similaire à Retour d’expérience - Architecture MicroService chez BotsUnit

Au coeur du framework .net 4.5.1
Au coeur du framework .net 4.5.1Au coeur du framework .net 4.5.1
Au coeur du framework .net 4.5.1Cellenza
 
Au cœur du Framework .NET 4.5.1
Au cœur du Framework .NET 4.5.1Au cœur du Framework .NET 4.5.1
Au cœur du Framework .NET 4.5.1Microsoft
 
2012 02-09-eranea-presentation-jug-lausanne
2012 02-09-eranea-presentation-jug-lausanne2012 02-09-eranea-presentation-jug-lausanne
2012 02-09-eranea-presentation-jug-lausanneDidier Durand
 
Sébastien Coutu: Copy this Meetup Devops - microservices - infrastructure imm...
Sébastien Coutu: Copy this Meetup Devops - microservices - infrastructure imm...Sébastien Coutu: Copy this Meetup Devops - microservices - infrastructure imm...
Sébastien Coutu: Copy this Meetup Devops - microservices - infrastructure imm...MSDEVMTL
 
Tartine - Pixelle, Refonte de l’ingestion et présentation de l’architecture
Tartine - Pixelle, Refonte de l’ingestion et présentation de l’architectureTartine - Pixelle, Refonte de l’ingestion et présentation de l’architecture
Tartine - Pixelle, Refonte de l’ingestion et présentation de l’architectureconfluent
 
Cellenza microservices - tour d'horizon - v0.1
Cellenza   microservices - tour d'horizon - v0.1Cellenza   microservices - tour d'horizon - v0.1
Cellenza microservices - tour d'horizon - v0.1Radoine Douhou
 
Saas Libre
Saas LibreSaas Libre
Saas Libregrolland
 
Architectures microservices
Architectures microservicesArchitectures microservices
Architectures microservicesRiadh MNASRI
 
Panel de solutions javascript
Panel de solutions javascriptPanel de solutions javascript
Panel de solutions javascriptjp_mouton
 
IBM Bluemix Paris meetup #23 - 20170425
IBM Bluemix Paris meetup #23 - 20170425IBM Bluemix Paris meetup #23 - 20170425
IBM Bluemix Paris meetup #23 - 20170425IBM France Lab
 
Plus de flexibilité et de scalabilité chez Bouygues Télécom grâce à MongoDB
Plus de flexibilité et de scalabilité chez Bouygues Télécom grâce à MongoDBPlus de flexibilité et de scalabilité chez Bouygues Télécom grâce à MongoDB
Plus de flexibilité et de scalabilité chez Bouygues Télécom grâce à MongoDBMongoDB
 
Plus de flexibilité et de scalabilité chez Bouygues Télécom grâce à MongoDB
Plus de flexibilité et de scalabilité chez Bouygues Télécom grâce à MongoDBPlus de flexibilité et de scalabilité chez Bouygues Télécom grâce à MongoDB
Plus de flexibilité et de scalabilité chez Bouygues Télécom grâce à MongoDBPierre-Alban DEWITTE
 
Morning with MongoDB Paris 2012 - Cas d'usages courant en entreprise. Présent...
Morning with MongoDB Paris 2012 - Cas d'usages courant en entreprise. Présent...Morning with MongoDB Paris 2012 - Cas d'usages courant en entreprise. Présent...
Morning with MongoDB Paris 2012 - Cas d'usages courant en entreprise. Présent...MongoDB
 
Track 2 - Atelier 3 - Comment Ysance met le cloud au service du digital avec ...
Track 2 - Atelier 3 - Comment Ysance met le cloud au service du digital avec ...Track 2 - Atelier 3 - Comment Ysance met le cloud au service du digital avec ...
Track 2 - Atelier 3 - Comment Ysance met le cloud au service du digital avec ...Amazon Web Services
 
Agile lille 2015 devops etapres
Agile lille 2015 devops etapresAgile lille 2015 devops etapres
Agile lille 2015 devops etapresLaurent Tardif
 
Keynote change 2013
Keynote change 2013Keynote change 2013
Keynote change 2013rbschange
 
MariaDB Paris Workshop 2023 - DARVA presentation
MariaDB Paris Workshop 2023 - DARVA presentationMariaDB Paris Workshop 2023 - DARVA presentation
MariaDB Paris Workshop 2023 - DARVA presentationMariaDB plc
 
Toutes les raisons d'adopter MongoDB
Toutes les raisons d'adopter MongoDBToutes les raisons d'adopter MongoDB
Toutes les raisons d'adopter MongoDBContent Square
 
Méthodes agiles, frameworks javascript: optimisez votre time to market
Méthodes agiles, frameworks javascript: optimisez votre time to marketMéthodes agiles, frameworks javascript: optimisez votre time to market
Méthodes agiles, frameworks javascript: optimisez votre time to marketmichael_bailly
 

Similaire à Retour d’expérience - Architecture MicroService chez BotsUnit (20)

Au coeur du framework .net 4.5.1
Au coeur du framework .net 4.5.1Au coeur du framework .net 4.5.1
Au coeur du framework .net 4.5.1
 
Au cœur du Framework .NET 4.5.1
Au cœur du Framework .NET 4.5.1Au cœur du Framework .NET 4.5.1
Au cœur du Framework .NET 4.5.1
 
2012 02-09-eranea-presentation-jug-lausanne
2012 02-09-eranea-presentation-jug-lausanne2012 02-09-eranea-presentation-jug-lausanne
2012 02-09-eranea-presentation-jug-lausanne
 
Sébastien Coutu: Copy this Meetup Devops - microservices - infrastructure imm...
Sébastien Coutu: Copy this Meetup Devops - microservices - infrastructure imm...Sébastien Coutu: Copy this Meetup Devops - microservices - infrastructure imm...
Sébastien Coutu: Copy this Meetup Devops - microservices - infrastructure imm...
 
Tartine - Pixelle, Refonte de l’ingestion et présentation de l’architecture
Tartine - Pixelle, Refonte de l’ingestion et présentation de l’architectureTartine - Pixelle, Refonte de l’ingestion et présentation de l’architecture
Tartine - Pixelle, Refonte de l’ingestion et présentation de l’architecture
 
Cellenza microservices - tour d'horizon - v0.1
Cellenza   microservices - tour d'horizon - v0.1Cellenza   microservices - tour d'horizon - v0.1
Cellenza microservices - tour d'horizon - v0.1
 
Saas Libre
Saas LibreSaas Libre
Saas Libre
 
Architectures microservices
Architectures microservicesArchitectures microservices
Architectures microservices
 
Panel de solutions javascript
Panel de solutions javascriptPanel de solutions javascript
Panel de solutions javascript
 
IBM Bluemix Paris meetup #23 - 20170425
IBM Bluemix Paris meetup #23 - 20170425IBM Bluemix Paris meetup #23 - 20170425
IBM Bluemix Paris meetup #23 - 20170425
 
_JCVFr
_JCVFr_JCVFr
_JCVFr
 
Plus de flexibilité et de scalabilité chez Bouygues Télécom grâce à MongoDB
Plus de flexibilité et de scalabilité chez Bouygues Télécom grâce à MongoDBPlus de flexibilité et de scalabilité chez Bouygues Télécom grâce à MongoDB
Plus de flexibilité et de scalabilité chez Bouygues Télécom grâce à MongoDB
 
Plus de flexibilité et de scalabilité chez Bouygues Télécom grâce à MongoDB
Plus de flexibilité et de scalabilité chez Bouygues Télécom grâce à MongoDBPlus de flexibilité et de scalabilité chez Bouygues Télécom grâce à MongoDB
Plus de flexibilité et de scalabilité chez Bouygues Télécom grâce à MongoDB
 
Morning with MongoDB Paris 2012 - Cas d'usages courant en entreprise. Présent...
Morning with MongoDB Paris 2012 - Cas d'usages courant en entreprise. Présent...Morning with MongoDB Paris 2012 - Cas d'usages courant en entreprise. Présent...
Morning with MongoDB Paris 2012 - Cas d'usages courant en entreprise. Présent...
 
Track 2 - Atelier 3 - Comment Ysance met le cloud au service du digital avec ...
Track 2 - Atelier 3 - Comment Ysance met le cloud au service du digital avec ...Track 2 - Atelier 3 - Comment Ysance met le cloud au service du digital avec ...
Track 2 - Atelier 3 - Comment Ysance met le cloud au service du digital avec ...
 
Agile lille 2015 devops etapres
Agile lille 2015 devops etapresAgile lille 2015 devops etapres
Agile lille 2015 devops etapres
 
Keynote change 2013
Keynote change 2013Keynote change 2013
Keynote change 2013
 
MariaDB Paris Workshop 2023 - DARVA presentation
MariaDB Paris Workshop 2023 - DARVA presentationMariaDB Paris Workshop 2023 - DARVA presentation
MariaDB Paris Workshop 2023 - DARVA presentation
 
Toutes les raisons d'adopter MongoDB
Toutes les raisons d'adopter MongoDBToutes les raisons d'adopter MongoDB
Toutes les raisons d'adopter MongoDB
 
Méthodes agiles, frameworks javascript: optimisez votre time to market
Méthodes agiles, frameworks javascript: optimisez votre time to marketMéthodes agiles, frameworks javascript: optimisez votre time to market
Méthodes agiles, frameworks javascript: optimisez votre time to market
 

Retour d’expérience - Architecture MicroService chez BotsUnit

  • 1. Retour d’expérience Architecture MicroService chez BotsUnit Grégoire Lejeune - Developper & Architect Mikael Robert - Devops & Infrastructure Architect
  • 2. Plan I Le microservice c’est quoi ? II Promesses et difficultés III Notre histoire avec le microservice IV Retour d’expérience
  • 3. I - Le microservice ?
  • 8. La littérature approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies. -- Fowler & Lewis user identity billing shopmail shop Store API
  • 9. II - Promesses et difficultés
  • 11. Isolation / Interdépendance Changer un élément implique de le changer partout, de revoir les tests partout et de redéployer l’ensemble. monolithe Bank User Shop
  • 12. Isolation / Interdépendance Changer un élément implique de le changer à un seul endroit, de modifier les tests à un seul endroit et de ne redéployer que le MS modifié. Shop Bank User Table
  • 13. Scalabilité Que ce qui est nécessaire ... billing ... ... shop ... ... billing shop shop Store Store Store Store Store Store Store 2 core 4 GB 2 core 4 GB 2 core 4 GB 4 core 8 GB 4 core 8 GB
  • 14. Scalabilité Tout ou rien monolithe monolithe monolithe SQL 8 core 32 GB 8 core 32 GB 8 core 32 GB 8 core 128 GB
  • 16. Défaillance Seul un élément est compromis. Design for failure ... ... ... ... ... ... ... Store Store Store Store Store Store Store
  • 17. Défaillance Seul un élément est compromis. Design for failure ... ... ... ... ... ... ... Store Store Store Store Store Store Store
  • 19. Difficultés Mise en place d’un mécanisme inter-services. Problème de transaction distribuées Complexité des tests ... ... ... ... ... ... ... ...... ... ... ...
  • 20. Difficultés Développement d’un Framework autour de Kafka (Event based). Message ∈ Transaction Kafka ... ... ... ... ... ... ... ... ... ... ... ...
  • 21. Difficultés Déploiement Utilisation des ressources physiques .erl .ex ... Store ... 1 4 3 Kafka 2
  • 22. So... ● Scaling Micro et non Macro ● Découpage ● Multi Langage / Polyglotte ● Un MS = Une micro équipe ● Eviter perte de contrôle du monolithe ● Tirer parti des avantages des différents hébergeurs ● Dizaines d’applications ○ Déploiement ○ Release management ● Énormément de machines à gérer ● REST/HTTP vs BUS ● Front ● Transactionnel ● Déporter la charge sur le réseau (+) (-)
  • 25. Une startup Fintech 1) Monolithe 2) SOA HTML JS CSS Rails Store Monolithe API Front HTML JS CSS Rails Store
  • 26. Une startup Fintech 1) Monolithe 2) SOA 3) MicroServices HTML JS CSS Rails Store Monolithe Store API Front HTML JS CSS Rails Kafka API Front Mail Gen File Virement ErlangErlangErlang Store
  • 27. Notre propre Startup ● Convaincus par le MS suite au REX On monte notre boîte ! ● Le Projet initial : ○ Plateforme à la Heroku mais orienté MicroServices ○ Framework microservices / kafka ○ Infra / DB / Middlewares on Demand Objectifs initiaux ● Très haute volumétrie (plusieurs M / jours) ● Prouver notre capacité à encaisser ● Tolérance à la panne, auto-guérison ● Coûts raisonnables pour ces objectifs
  • 28. Equipe ● Un investisseur / Directeur commercial. ● Un architecte d’applications Web de plus de 10 ans XP (MS et Streaming) ● Un CTO, 10 ans d’Erlang, Outils Cloud (Vidal, eNovance, Fintech). ● Un architecte d’infrastructure / devops, 8 ans XP (OCTO Technology, Startup Fintech) Erlang Elixir GCE Consul ChefDockerKafka
  • 29. Expérimenter la plateforme Démarrer : framework kafka + infra on demand avec des MS “tests” Conclusion rapide : On ne prouvait pas vraiment prouver notre efficacité avec des cas d’école, il fallait développer la plateforme avec un vrai projet Besoin : Prouver nos idées et la pertinence de nos outils Idée : Plateforme de streaming vidéo live/chat intéractive
  • 30. Principes de bases ● Framework Kafka, protocole et format de message commun ● Event based ● Duplication de donnée en local (cache) pour éviter de ré-appeler Kafka User Payment ChatStore Store From: User Payer : 1000 Recipient : 1001 Amount: 10 From: Payment Payer : 1000 Recipient : 1001 Amount: 10 Tip Notify
  • 31. Le premier micro service … le front Kafka ... Store front Store StandBy front API API
  • 32. Puis un deuxième : User Kafka ... ... Store user Store StandBy user API API
  • 33. Puis un troisième : Identity Kafka ... ... Store identity Store StandBy Identity API API ...
  • 34. Puis on en a rapidement 8, 10, 12 ... : front, user, identity, payment, broadcast, chat, realtime, shop.. Kafka ... ... ... ... ... ... ... ... ... ... ... ...
  • 36. Aujourd’hui : nos avantages ● Le produit fonctionne bien, il est prêt à être lancé :) ● Tolérance à la panne : Quand un service plante, on ne perd pas tout le site ● Mise à jour service par service (voir aussi le point précédent) ● Asynchrone - traitement de masse ● Scaling des composants indépendant ● Optimisation indépendante : en optimisant un service, on ne risque pas d’effets de bords sur un autre ● On pourrait sous traiter le développement de micro services
  • 37. Aujourd’hui : nos douleurs 1. Trop de machines a. Cela coûte cher ... b. Même notre prototype opérationnel Kubernetes en souffre, difficile à stabiliser 2. Trop de bases de données a. Extrêmement difficile en exploitation b. Consistance difficile à assurer 3. Des microservices devenu des mini monolithes 4. Deux sources de vérité pour les données : Kafka et les BDD 5. Le front est devenu un plat de spaghettis
  • 38. 1. Trop de machines ● Plus simple de debugger dans une VM que dans un container ● Etape 1 : Travail pour réduire la consommation en idle (polling kafka et BDDs) ● Etape 1.5 : Optimisation qui n’ont pas pu être faites à cause de la pression des features ● Etape 2 : Diminuer le nombre de serveurs de base de données ● Etape 3 : Tout mettre dans Kubernetes
  • 39. 2. Trop de base de données ● Golden Hammer : on sait faire avec Postgres on met Postgres partout ○ Très loin d’être adapté à tous les cas ○ Scale mal ● Pistes étudiées actuellement : ○ 1 cluster Postgres, 1 cluster Redis et 1 cluster Cassandra, le tout en commun ○ Bascule vers Redis plein de data qui sont uniquement temporaires ou du cache ○ Passer de N bases à M bases (mutualiser certaines bases entre des microservices)
  • 40. 3. Des microservices devenu des mini monolithes Payment Encheres Tipping Achat Ventes Enchères Tipping VentesAchats
  • 41. 4. Deux sources de vérités pour les données ● Les données arrivent par Kafka, mais sont aussi stockées en base. ○ Qui a raison en cas de conflit? De duplicata ? ● Très conflictuel quand on a un soucis, on ne sait jamais trop quelle source prendre ● Kafka pour la reprise sur erreur ○ Parfaitement adapté ● Le cluster cassandra commun pourrait être une solution ○ Scalable ○ Haute performance
  • 42. 5. Le front plat de spaghettis ● Front V2, refonte complète ○ On voudrait faire une SPA, mais toujours problème de SEO ○ Mettre le CSS et le JS dans un seul microservice et pas dans tous, partie par partie évitera pas mal de soucis et permettra la réutilisation ● Avantages : ○ On ne multiplie plus les endroits pour modifier le front ● Inconvénients : ○ On risque de devoir mettre à jour ce service chaque fois qu’un autre évolue
  • 43. Monolithe vs Microservices : Design for Failure : l’architecture idéale (selon nous) Shop PaymentUserChat SPA: HTML JS CSS CDN SPA: HTML/CSS/JS
  • 44. Monolithe vs Microservices : Design for Failure : l’architecture idéale (selon nous) Shop PaymentUserChat SPA: HTML JS CSS CDN SPA: HTML/CSS/JS
  • 45. Nos conseils ● Evitez de courir deux chevaux à la fois. ○ Équipe d’experts et pattern maîtrisés. ○ R&D ● Pas de pattern leader. ● Faire un choix et s’y tenir. ● Éviter les effets de mode. Le micro service est sans hésiter l’avenir de l’architecture IT
  • 46. Questions ? Q & A gregoire.lejeune@botsunit.com @glejeune /glejeune mikael.robert@botsunit.com @mikaelrob /mikrob /botsunit