Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • One also needs to be able to handle some client accessing retired ID's (whether eventual or not). Some designs will keep the ID's yet mark them as retired (to ensure they never get reused, and/or to differentiate between invalid ID's and retired ID's). Commented Oct 23, 2015 at 17:28
  • @ErikEidt: I use UUID's, so accidentally re-using an ID is a pretty uncommon scenario. Also, retired tracks are removed from the query repos, so they will not be visible to other users. Commented Oct 26, 2015 at 10:17
  • @VoiceOfUnreason, Saga, interesting! But I don't get this part: "The Saga uses the userId to query the TracksRepository/Projection for the list of tracks to be removed, and enumerates them." How do I do that if I use pure ES? The Track Aggregate can only be "inflated" from replaying the events for a specific TrackID, so no fancy querying possible... Or do I miss something? Commented Oct 26, 2015 at 10:24
  • 1
    I think you are missing that the saga is working from the read model. If there was infinite memory, you would always have the list of tracks that the saga needs available - the saga would just use UserRemovedEvent.userId to look everything up. You probably don't have infinite memory, though, so you either (a) persist the result set you need on write, and then load the data you need from the persistent store on read or (b) read all the user's events to get the list of trackIds you need, and reload the events for each track. Commented Oct 26, 2015 at 13:22
  • 1
    Just a little side warning: there's been a little shake in the DDD/CQRS community around the terms Saga and Process Managers (as defined in Enterprise Integration Patterns). In some places they mean the same thing, somewhere else they mean different things. Be prepared to bump into some inconsistencies, when digging for information. Commented Oct 27, 2015 at 9:41