CQRS / Event Sourcing im Content Repository

CQRS / Event Sourcing im Content Repository

Oliver Hader vom TYPO3 Kernteam und ich erklären gemeinsam die Konzepte und Vor- und Nachteile von Event Sourcing und CQRS, am Beispiel von Neos und TYPO3 CMS. Gehalten auf dem TYPO3Camp Mitteldeutschland.

Vortrag als Video: https://www.youtube.com/watch?v=lefgKJSWqx0&t=4968
Ollys Masterarbeit: https://www.slideshare.net/ohader/typo3-cms-datenmodifikation-event-sourcing-masterarbeit

30c0b6f50f67163bee8500aa4115d126?s=128

Sebastian Kurfürst

January 25, 2019
Tweet

Transcript

  1. CQRS / Event Sourcing im Content Repository TYPO3Camp Mitteldeutschland 25./26.01.2019

  2. Sebastian Olly

  3. Who has an idea what CQRS/ES is? *you?

  4. Basic Idea 
 (Event Sourcing & CQRS)

  5. None
  6. Big Picture Before NodeInterface API Doctrine ORM NodeData Repository DB

  7. Big Picture Before Commands State Queries

  8. write side read side Event store (DB Table) Projection 1

    (e.g. various DB tables) Commands Events Projection 2 (soft) constraints
  9. write side read side Event store (DB Table) Content Graph

    Commands Events Workspace Dirtyness (soft) constraints …
  10. None
  11. immediately consistent strongly consistent not consistent eventually consistent

  12. TYPO3 Data Architecture Repository & Reconstitution Routing Controller View Model

    Permission Persistence Infrastructure Frontend Extbase Backend EditDocumentController FormEngine <<TCA>> FormDataProvider BackendUserAuthentication DataHandler RelationHandler TypoScriptFrontendController ActionContoller AbstractView AbstractEntity & AbstractValueObject Repository Typo3DbBackend Backend PersistenceManager DataMapper StandaloneView <<custom>> ConnectionPool Connection <<TCA>> AbstractPlugin ContentObjectRenderer Frontend\RequestHandler Backend\RouteDispatcher Backend\RequestHandler MVC\Dispatcher <<TypoScript>> <<direct database operations>> <<direct database operations>> x x x
  13. Localization in TYPO3 DataHandlerController DataHandler RelationHandler DatabaseConnection translate <<create>> localize()

    copyRecord() <<create>> DataHandler process_datamap() last_insert_id() fetch record record [x]-processDBdata() <<create>> start() fetch references references writeForeignField() update references insert record new_record_id new_record_id new_record_id references new_record_id multiple read & write processes
  14. Context & Overlays is translation of uid 13 sys_language_uid 0

    :tt_content l10n_parent 0 header Message pid 100 t3ver_wsid 0 t3ver_state 0 t3ver_oid 0 uid 27 sys_language_uid 1 :tt_content l10n_parent 13 header Nachricht pid 100 t3ver_wsid 1 t3ver_state 1 t3ver_oid 0 uid 28 sys_language_uid 1 :tt_content l10n_parent 13 header Nachricht pid -1 t3ver_wsid 1 t3ver_state -1 t3ver_oid 27 uid 41 sys_language_uid 0 :tt_content l10n_parent 0 header News pid -1 t3ver_wsid 1 t3ver_state 0 t3ver_oid 13 is workspace version of is new version is default version is workspace version of is new palceholder
  15. Olly's Master Thesis https://www.slideshare.net/ohader/ typo3-cms-datenmodifikation-event- sourcing-masterarbeit

  16. COMMAND Update node properties properties: text: oldValue: "Down the Rabbit-"

    newValue: "Down the Rabbit-Hole" nodeAggregateIdentifier: uuid dimensionSpacePoint: ... contentStreamIdentifier: uuid Down the Rabbit-Hole Editing With Events
  17. EVENT STORE EVENT Node properties were updated properties: text: oldValue:

    "Down the Rabbit-" newValue: "Down the Rabbit-Hole" nodeAggregateIdentifier: uuid dimensionSpacePoint: ... contentStreamIdentifier: uuid COMMAND HANDLER e1 Editing With Events COMMAND Update node properties properties: text: oldValue: "Down the Rabbit-" newValue: "Down the Rabbit-Hole" nodeAggregateIdentifier: uuid dimensionSpacePoint: ... contentStreamIdentifier: uuid
  18. e1 EVENT STORE e1 Node properties were updated e2 NodeAggregateWithNode

    was created e3 Node properties were updated e4 Create Workspace Editing With Events
  19. Workspaces 
 aka Content Streams

  20. Workspaces e1 Live Workspace A e2 e3 merging works

  21. Workspaces e1 Live Workspace A e2 e3 merge conflict e4

  22. Workspaces e1 Live Workspace A e2 e3 merge successful e4

    e2’ e3’
  23. Content Stream 1 user-sebastian Content Stream 2

  24. changes to live workspace 
 are not immediately visible!

  25. immediately consistent strongly consistent not consistent eventually consistent

  26. versioning editing notifications better read performance undo/redo intelligent write conflict

    resolution synchronization of content across instances our feature wishes
  27. Events

  28. Donnerstag, 14. März, 14:00-18:00 kostenfrei

  29. neoscon.io 10% Rabattcode: Neos-Kickstart 10.-11.05.2019

  30. Summary

  31. www.neos.io