Upgrade to Pro — share decks privately, control downloads, hide ads and more …

La simplicité comme moyen d'être performant, ré...

La simplicité comme moyen d'être performant, résilient et de réduire le Time To Market.

Il y a 1 an et demi, la Société Générale a décidé de construire un nouveau service de vente électronique de nos produits financiers. Les contraintes étaient claires : "le système sera performant, auditable, résilient et développé de manière à avoir un Time To Market court". Une seule solution s'imposait à nous : faire simple, très simple !
Ainsi à travers cette présentation, nous vous raconterons notre quête de simplicité. Vous verrez ainsi que notre stack technique ne contient quasiment aucun framework, juste quelques bibliothèques utiles ou indispensables. Notre code se structure autour de quelques principes : l'Event Sourcing, un peu de Domain Driven Design et une discipline de fer en matière de qualité et de tests automatisés (BDD for the win!).

Marie-Laure Thuret

June 03, 2015
Tweet

More Decks by Marie-Laure Thuret

Other Decks in Programming

Transcript

  1. Construire le SI de demain REX Société Générale La simplicité

    comme moyen d'être performant, résilient et de réduire le Time To Market
  2. Marie-Laure Thuret @mlthuret Développeur chez Clément Héliou @c_heliou Développeur chez

    Thierry Abaléa @ThierryAbalea Tech Lead à la Société Générale
  3. « Capture all changes to an application state as a

    sequence of events » Martin Fowler
  4. Date Money Out Money In 2015/05/14 100 € 2015/05/14 -20

    € 2015/05/16 -30 € 2015/05/24 380 € 2015/06/01 -70 € Total -120 € 480 € Balance 360 €
  5. WithdrawalPerformed accountId: 9387 amount: 30€ BankAccount id: 9387 balance: 0€

    WithdrawalPerformed accountId: 9387 amount: 20€ DepositPerformed accountId: 9387 amount: 100€ BankAccount id: 9387 balance: 50€ BankAccount id: 9387 balance: 100€ BankAccount id: 9387 balance: 80€ Inspired by B. Reitzammer & J. Seitz - http://ookami86.github.io/event-sourcing-in-practice Apply to Apply to Apply to Produces Produces Produces
  6. BankAccount id: 9387 balance: 0€ WithdrawalPerformed accountId: 9387 amount: 20€

    DepositPerformed accountId: 9387 amount: 100€ BankAccount id: 9387 balance: 100€ Bug Inspired by B. Reitzammer & J. Seitz - http://ookami86.github.io/event-sourcing-in-practice Apply to Apply to Produces Produces
  7. WithdrawalPerformed accountId: 9387 amount: 30€ BankAccount id: 9387 balance: 0€

    WithdrawalPerformed accountId: 9387 amount: 20€ DepositPerformed accountId: 9387 amount: 100€ BankAccount id: 9387 balance: 100€ BankAccount id: 9387 balance: 70€ Inspired by B. Reitzammer & J. Seitz - http://ookami86.github.io/event-sourcing-in-practice Apply to Apply to Produces Produces
  8. « DDD is about designing software based on models of

    the underlying (business) domain » Martin Fowler
  9. Multiplus Business Logic ReceiveQuote {command} QuoteReceived {event} QuoteForwarded {event} Customer

    Event Bus QuoteForwardedHandler {handler} Quote Requesting Quoting QuoteReceived {event} QuoteReceived {event} ForwardQuote {action}
  10. Transaction {aggregate root} Pricing {entity} Execution {entity} Orchestration {entity} ReceiveQuote

    {command/value object} quoteRequestId: 4563 price: 100€ QuoteReceived {event/value object} accountId: 4563 price: 110€ - Multiplus Business Logic -
  11. Multiplus Business Logic ReceiveQuote {command} quoteRequestId: 4563 price: 100€ QuoteForwarded

    {event} accountId: 4563 price: 101€ Multiplus Business Logic ReceiveQuote {command} quoteRequestId: 4563 price: 100€ QuoteForwarded {event} accountId: 4563 price: 102€ 2015/06/01 Margin: 1% 2015/11/01 Margin: 2%
  12. Multiplus Business Logic ReceiveQuote {command} QuoteForwarded {event} Customer Event Bus

    QuoteForwardedHandler {handler} {Quote n° 65746} {Quote n° 65746} ?? QuoteReceived {event} ForwardQuote {action}
  13. Multiplus Business Logic ReceiveQuote {command} QuoteForwarded {event} Customer Event Bus

    QuoteForwardedHandler {handler} Customer gateway {Quote n° 65746} {Quote n° 65746} QuoteReceived {event} ForwardQuote {action}
  14. Multiplus Business Logic ReceiveQuote {command} quoteRequestId: 4563 price: 100€ QuoteForwarded

    {event} accountId: 4563 price: 101€ Multiplus Business Logic 2015/06/01 Margin: 1% 2015/11/01 Margin: 2% QuoteForwarded {event} accountId: 4563 price: 101€
  15. Multiplus Business Logic ReceiveQuote {command} QuoteForwarded {event} Customer Event Bus

    QuoteForwardedHandler {handler} QuoteReceived {event} ForwardQuote {action}
  16. Date Money Out Money In 2015/05/14 100 € 2015/05/14 -20

    € 2015/05/16 -30 € 2015/05/24 30 € 2015/06/01 -70 € Total -120 € 130 € Balance 10 €
  17. Given a quantity value of 1000 in G When the

    quantity is converted in OZ Then the converted quantity is 32.1507 OZ Given a quote request with a way BUY And the credit check request has been sent When the credit check response is in error Then the pricer does not receive a quote request And the platform quote status is REJECTED Given an authorized product type When the customer sends the rfs Then the pricer receives the rfs When the pricer sends a quote Then the customer receives the quote Workflow Feature Unit