MateuszNaKodach / SelfImprovement

This project has some sample code for my personal learning purpose. Things which I've learnead are collected as issues here: https://github.com/nowakprojects/SelfImprovement/issues
107 stars 17 forks source link

Kill Aggregate! The aggregate is dead. Long live the aggregate! (Sara Pellegrini & Milan Savić) #5294

Open MateuszNaKodach opened 1 year ago

MateuszNaKodach commented 1 year ago

The Aggregate is dead. Long live the Aggregate! by Sara Pellegrini & Milan Savic @ Spring I/O 2023 https://www.youtube.com/watch?v=IgigmuHHchI

The aggregate is dead. Long live the aggregate! (Sara Pellegrini & Milan Savić) https://www.youtube.com/watch?v=0iP65Durhbs

https://sara.event-thinking.io/2023/04/kill-aggregate-chapter-1-I-am-here-to-kill-the-aggregate.html

https://www.youtube.com/watch?v=DhhxKoOpJe0&t=150s

contention - co to znaczy w tym kontekscie?

MateuszNaKodach commented 1 month ago

image

MateuszNaKodach commented 1 month ago

image

MateuszNaKodach commented 1 month ago

image

Story telling sie psuje, kiedy wprowadzamy agregat.

MateuszNaKodach commented 1 month ago

image Broni inwariantów, a jeszcze jest konceptem biznesowym.

MateuszNaKodach commented 1 month ago

Course Aggregate

image

MateuszNaKodach commented 1 month ago

image

MateuszNaKodach commented 1 month ago

image

Storage: image

image Update Course Capacity - musimy ladowac caly

MateuszNaKodach commented 1 month ago

Event Source - ladujemy wszystkie eventy

image

MateuszNaKodach commented 1 month ago
image

Jak bysmy caly system zrobili, to wtedy nie ma concurrency.

MateuszNaKodach commented 1 month ago

To jest słaby przykłąd, bo tutaj nie ma żadnej reguły:

image
MateuszNaKodach commented 1 month ago

Alternatywne rozwiazanie:

image image
MateuszNaKodach commented 1 month ago

Nowa regula: student nie moze dolaczyc do wiecej niz 10 kursów:

image

Podobne eventy dla niego:

image image
MateuszNaKodach commented 1 month ago
image image
MateuszNaKodach commented 1 month ago
image
MateuszNaKodach commented 1 month ago
image
MateuszNaKodach commented 1 month ago
image

Mozemy miec czlowieka, ktory patrzy na stan systemu i podejmuje decyzje i tak samo czesc software, ktora tez podejmuje decyzje.

MateuszNaKodach commented 1 month ago
image
MateuszNaKodach commented 1 month ago
image

Odczytam tylko konieczne eventy... Bedziemy dzielic eventy na certain query:

image image
MateuszNaKodach commented 1 month ago

To co pozwoliło nam pozbyć się agregatu, conditional append: zamiast samego append:

image

No new events matching the query after the last event. Decision events doesnt changed..

MateuszNaKodach commented 1 month ago
image
MateuszNaKodach commented 1 month ago

Mamy eventy rozne (bo rozne agregaty), ale one reprezentuja ten sam fakt przykładowo:

image

W story telling to jest jedno:

image

Co mozemy zrobic? Dodajemy "domain indentifiers" - tagi:

image image

Mamy 1 event, ale 2 pointers.

MateuszNaKodach commented 1 month ago

Jak to teraz dziala?

image image

Bierzemy z 1 stream te 2 eventy. Sprawdza 2 business rules:

image

Domain Event:

image image
MateuszNaKodach commented 1 month ago

Czy ten przykłąd, który podają nie robi tak, że teraz w jednym stream mamy ten kurs i zapisy WSZYSTKICH na WSZYSTKIe kursy?

Tutaj chyba nie maja znaczenia streamy w ogóle, tylko domain identifier.

MateuszNaKodach commented 1 month ago
image
MateuszNaKodach commented 1 month ago
image image

Nie bylo potrzeba Sagi teraz. Ale jesli bediemy mieli wiele Contextów, to oczywiscie jest to potrzebne.

Jak sie odbywa refaktor granic:

image
MateuszNaKodach commented 1 month ago

The aggregate is dead:

image
MateuszNaKodach commented 1 month ago

Clustering commands into logical groups and delegate to the same model the exeution. Difference - this is model needs to be isolated from each others.

killing the aggregate = admit the possiblity of contaiminations, bez psucia consistency - dynamic approach