Replies: 3 comments
-
There are at least few approaches for that :)
If the |
Beta Was this translation helpful? Give feedback.
-
Hey @swistak35 thanks for this extended reply! Sadly, that's an open source project and i don't have budget to hire anyone for consultancy - but who knows, maybe one day :) If you are curious - i'm working on rails engine to make it easier to integrate existing apps with ActivityPub "fediverse" (protocol for federation behind Mastodon social network - https://activitypub.rocks/). It's model fits perfectly with Event Streaming IMO so i decided to give it a try. Anyway - option no. 1 looks pretty nice (especially that i can query for specific events in such stream, not all of them) but one thing bothered me from first minutes of playing with RES - is that possible to specify to which stream event should be assigned in the AggregateRoot class ?
based on the docs, the only place i can specify a stream(s) is a Thank you! |
Beta Was this translation helpful? Give feedback.
-
Check out: https://railseventstore.org/docs/app/ The event sourcing is described at this page. In particular:
(and in the same way, when storing aggregate in I'll close the issue for now :) |
Beta Was this translation helpful? Give feedback.
-
Hey there! First of all, thank you for this great piece of software.
I'm not sure if that's a proper way to ask general best-practice questions but let's give it a shot. If not, please forgive me.
I'm building a system which receives a pretty complicated JSON object and needs to validate it async and, if it's valid, it needs to make a further work. Obviously that's a really simplified description of what's really going on.
As those incoming JSON objects are kind of like commands of what to do with actual models (Create/Update/Vote/etc), i decided to go for RES and test it out. Everythng goes smoothly so far but i'm unsure about one detail. Let's say steps are as follows:
ActivityCreated
event is created in RESActivity
is successfull,ActivityAccepted
event is createdActivityRejected
event is createdApps using that can subscribe to
ActivityAccepted
event and do further work. By "further work" i mean reading data from the JSON object persisted in step 2.Right now, i subscribe to
ActivityAccepted
and gets the received JSON using the following code instead of storing the same JSON withActivityAccepted
event:As it works pretty well, is that a proper way of dealing with data in ES world? Should i pass the original JSON to the
ActivityAccepted
event (and any other further event)? Are there any best practices regarding that? Right now, the only contents ofActivityAccepted
event are the state changed toaccepted
Thanks in advance for any tips!
Beta Was this translation helpful? Give feedback.
All reactions