Re:Show HN: Light implementation of Event Sourcing using Pos...
by lacrosse_tannin on Tuesday October 31, 2023 @01:17PM
(#38088198)
How do you roll the history up into the current state? I get the idea, but where is the actual code or query that does this? Especially how do you make an up to date read model with postgres?
[ Parent
| on HN ]
Re:Show HN: Light implementation of Event Sourcing using Pos...
by eugene-khyst on Tuesday October 31, 2023 @02:04PM
(#38088889)
Here is the code <https://github.com/eugene-khyst/postgresql-event-sourcing/bl...>
Re:Show HN: Light implementation of Event Sourcing using Pos...
by koevet on Wednesday November 01, 2023 @02:29AM
(#38095180)
I noticed that you use the @Transactional annotation on class definition. This will create a write transaction for every public method of the annotated class, including read only methods. You should consider using readOnly=true for read methods.
Additionally, I would consider using two data sources, one for write queries and a read only ds for the Q part of CQRS.
Re:Show HN: Light implementation of Event Sourcing using Pos...
by eugene-khyst on Wednesday November 01, 2023 @04:38AM
(#38095848)
Thanks for suggestions. I will add @Transactional(readOnly = true) annotation. I will mention in the README the possibility of using two data sources.
Re:Show HN: Light implementation of Event Sourcing using Pos...
by lacrosse_tannin on Wednesday November 01, 2023 @10:56AM
(#38099022)
alright thanks. this java stuff is pretty hard for me to follow. it looks like java is doing the aggregating, but maybe this is some kind of ORM