This talk has been given at Montpellier JS, in June 2017 for the first time.
This is a synthesis of different implementations, during 3 years, following a DDD approach, using Node.js, that are now live in production.
The code has been produced to be run with Node.js 8.
5. DOMAIN DRIVEN DESIGN
Approche de conception de systèmes complexes
Emergence d'un modèle pour représenter le
domaine cible
Créer les conditions d'une collaboration efficace
entre experts du domaine et l'équipe de réalisation
22. CQRS
Enjeux différents
Queries : indexation, aggrégation, projection
Commands : consistance
On peut aussi séparer
Les modèles : normalisation VS dénormalisation
Les sources de données
Pattern très intéressant pour scaler
31. EVENT SOURCING
Commande: "Ajouter une carotte au pot au feu 42"
Aggregate Id Event Data Version
PotAuFeu 42 préparation_lancée null 1
PotAuFeu 42 carotte_ajoutée {nb:1} 2
32. EVENT SOURCING
Commande: "Ajouter 2 choux au pot au feu 42"
Aggregate Id Event Data Version
PotAuFeu 42 préparation_lancée null 1
PotAuFeu 42 carotte_ajoutée {nb:1} 2
PotAuFeu 42 chou_ajouté {nb:2} 3
33. EVENT SOURCING
Commande: "Ajouter une carotte au pot au feu 42"
Aggregate Id Event Data Version
PotAuFeu 42 préparation_lancée null 1
PotAuFeu 42 carotte_ajoutée {nb:1} 2
PotAuFeu 42 chou_ajouté {nb:2} 3
PotAuFeu 42 carotte_ajoutée {nb:1} 4
34. EVENT SOURCING
Commande: "Retirer une carotte du pot au feu 42"
Aggregate Id Event Data Version
PotAuFeu 42 préparation_lancée null 1
PotAuFeu 42 carotte_ajoutée {nb:1} 2
PotAuFeu 42 chou_ajouté {nb:2} 3
PotAuFeu 42 carotte_ajoutée {nb:1} 4
PotAuFeu 42 carotte_retirée {nb:1} 5