-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Composable event sourcing #65
Comments
@SemanticBeeng Since you reference my example, I'll try to address some questions of yours.
For sure you can use them separately. As I show in Part 3 of the series, you can launch an eventsourced behavior without any read side. In theory, you can even read the whole state from the same aggregate, although such solution is much harder to scale properly. Actually there's not a lot Aecor has to offer in terms of CQRS. You can just get a partitioned stream of entity events. That's it, then you do whatever you want with it.
Could you please elaborate on what you mean here by orchestration? There are several processes here, which are all different. More specific questions about a specific process would be much easier to answer. Anyway, Aecor itself does NO orchestration whatsoever. The only remotely related thing it does is it distributes processing over the cluster (and only when it's possible - it requires event stream to be properly partitioned). Overall, the way processes are defined in my example is inspired by Process Manager pattern, which is much more on choreography side (at least in this form), rather than orchestration. I plan to dedicate Part 5 of the series to this matter, maybe it will clarify some questions as well :) |
Key design choice indeed.
As per https://stackoverflow.com/a/29808740/4032515
In my initial comment above meant to focus on composition with functional programming - a Will follow up and improve this answer. Examples to clarify
|
@SemanticBeeng is there anything I can help with?
Sure, MonadActionReject is all you need for that. |
I think the gist of my pursuit at that time was to see how to write Since asking this have learned more about Still, it would be great if you could sketch the functionality of the example from this article in |
This is a design exploration of composability / orchestration patterns.
Resources as context
"
COMPOSABLE EVENT SOURCING WITH MONADS
"http://www.lambdadays.org/static/upload/media/1519724460390566danielkrzywickieventsourcing.pdf
https://stackoverflow.com/questions/51160457/event-sourcing-without-cqrs
https://microservices.io/patterns/data/saga.html
"
The Application of Petri Nets to Workflow Management
"http://wwwis.win.tue.nl/~wvdaalst/publications/p53.pdf
Questions.
Are
event sourcing
andCQRS
welded together inAecor
or can they be used separately?Can
Aecor
be used to implement all use cases from "COMPOSABLE EVENT SOURCING WITH MONADS
" ? (please skim through presentation to offer an initial assessment if any show stoppers exist before going deeper to prove)How to implement
checkpointing
rolling snapshot
s withAecor
(could be thought of related to composability). (see https://cqrs.files.wordpress.com/2010/11/cqrs_documents.pdf for definition)In the banking app example the assumption of all account transactions being held in memory is not realistic. Thinking that if in a real implementation the transactions would be stored in another persistent repository and the aggregate would keep the transactions not yet checkpointed. If so, then these methods would need to be implemented differently
aecor/modules/example/src/main/scala/aecor/example/account/EventsourcedAlgebra.scala
Lines 42 to 46 in be6b979
If this line of thinking is agreeable with you then please share some thoughts on techniques to achieve this. Maybe to suspend the ~
rolling snapshot
s in a separateeffect
?update 2018/01/06 : Found
"Scaling Event-Sourcing at Jet"
very useful.I have a number of real applications with non trivial such business logic it seems it would be warranted to encapsulate in separate
effect
s (could use the other effects likeSync
andMoandError
for example).Disclaimer: I know this is rough, sorry, and still working through how composition / orchestration is done in https://github.com/vpavkin/ticket-booking-aecor/blob/master/booking/src/main/scala/ru/pavkin/booking/ProcessWirings.scala (seems
CQRS
based).The text was updated successfully, but these errors were encountered: