L’Event Sourcing et CQRS sont sur toutes les lèvres en cette année 2016 qui marque l’avènement des systèmes dits « réactifs » ou « dirigés par les évènements ». Bien que leur présence ne date pas d’hier, peu d’applications en tire aujourd’hui bénéfice. Dans ce retour d’expérience, nous allons vous présenter dans le détail et en toute transparence, l’implémentation mise en place au sein d’une grande banque d’investissement française, ses avantages, ses inconvénients et les leçons que nous avons en tiré. Nous espérons vous donner ainsi le bagage nécessaire pour vous lancer à votre tour dans la grande aventure du réactif.
7. @c_heliou @xebiconfr #xebiconfr 7
Application
Inspiré par J. Chassaing - http://thinkbeforecoding.com/post/2014/01/04/Event-Sourcing.-Draw-it
Commande
Fonction de
Décision
9. @c_heliou @xebiconfr #xebiconfr 9
Application
Inspiré par J. Chassaing - http://thinkbeforecoding.com/post/2014/01/04/Event-Sourcing.-Draw-it
Fonction de
Décision
Commande
Fonction
d’évolution
Évènement(s)
Event
store
10. @c_heliou @xebiconfr #xebiconfr 10
Fonction d’évolution
(état courant + évènement)
=> nouvel état
Pour chaque évènement émis par
la fonction de décision
11. @c_heliou @xebiconfr #xebiconfr 11
Application
Inspiré par J. Chassaing - http://thinkbeforecoding.com/post/2014/01/04/Event-Sourcing.-Draw-it
Évènement(s)
Fonction de
Décision
Commande
Fonction
d’évolution Event
store
Action
Effets de bord
19. @c_heliou @xebiconfr #xebiconfr 19
Application
Inspiré par J. Chassaing - http://thinkbeforecoding.com/post/2014/01/04/Event-Sourcing.-Draw-it
Fonction de
Décision
RecevoirPrix
{commande}
22. @c_heliou @xebiconfr #xebiconfr 22
Application
Inspiré par J. Chassaing - http://thinkbeforecoding.com/post/2014/01/04/Event-Sourcing.-Draw-it
Fonction de
Décision
RecevoirPrix
{commande}
Fonction
d’évolution
PrixReçu
{évènement}
24. @c_heliou @xebiconfr #xebiconfr 24
Application
Inspiré par J. Chassaing - http://thinkbeforecoding.com/post/2014/01/04/Event-Sourcing.-Draw-it
Fonction de
Décision
RecevoirPrix
{commande}
Fonction
d’évolution
PrixReçu
{évènement}
Demande
de prix
Réception
de prix
PrixReçu
{évènement}
TransférerPrix
{action}
PrixTransféré
{évènement}
35. @c_heliou @xebiconfr #xebiconfr 35
Application
Inspiré par J. Chassaing - http://thinkbeforecoding.com/post/2014/01/04/Event-Sourcing.-Draw-it
Évènement(s)
Fonction de
Décision
Commande
Fonction
d’évolution Event
store
Action
36. @c_heliou @xebiconfr #xebiconfr 36
Application
Inspiré par J. Chassaing - http://thinkbeforecoding.com/post/2014/01/04/Event-Sourcing.-Draw-it
Évènement(s)
Fonction de
Décision
Commande
Fonction
d’évolution Event
store
Action
37. @c_heliou @xebiconfr #xebiconfr 37
Recevoir prix
{commande}
requêteId: 9387
prix: 100€
Fonction de
Décision
Fonction de
Décision
Prix reçu
{évènement}
requêteId: 9387
prix: 100€
marge: 0,10€
Recevoir prix
{commande}
requêteId: 9387
prix: 100€
Prix reçu
{évènement}
requêteId: 9387
prix: 100€
marge: 0,20€
12/02/2016 - Marge 0,1%
01/07/2016 - Marge 0,2%
38. @c_heliou @xebiconfr #xebiconfr 38
Dénommer un évènement
n’est pas chose Aisée.
« Anatomy of domain event »
M. Praglowski - http://blog.arkency.com/2016/05/the-anatomy-of-domain-event/
45. @c_heliou @xebiconfr #xebiconfr 45
Bus d’évènements
Multiplus
Handler
PUSH-API
Fonction de
STOCKAGE
Fonction
D’AGREGATION
Event
store
Évènement
QUEUE EMS
WEB
SOCKETVue CONSOLE
Vue
46. @c_heliou @xebiconfr #xebiconfr 46
PUSH-API
Fonction de
STOCKAGE
Fonction
D’AGREGATION
Event
store
WEB
SOCKET
CONSOLE
Évènement
{transaction #345}
Évènements
{transaction #345}
Vue
{transaction #345}
Vue
{transaction #345}
53. @c_heliou @xebiconfr #xebiconfr 53
Ressources
๏Xebicon 15’ - CQRS + Event Sourcing: en direct !
๏Back Day 15’ - Explorer les principes de l’event sourcing
๏Thinkbe4coding #Eventsourcing
๏KATA MixteR
- https://github.com/devlyon/mixter
- Kata explorant les principes de l’Event Sourcing/CQRS.
- https://www.youtube.com/watch?v=QGGZs0KqxZw
- Live coding présentant les principes de l’Event Sourcing/CQRS.
- http://thinkbeforecoding.com/tag/Event%20Sourcing
- L’un des auteurs français à suivre sur le sujet Event Sourcing/CQRS.
- http://www.xebia.tv/vod?videoId=S8566fyZHp0
- Présentation plus large du projet Multiplus (DDD, BDD, Architecture hexagonale).