DDD/CQRS - Modifying write model solely to support read model projection

38 views
Skip to first unread message

Richard Rodseth

unread,
Sep 27, 2016, 4:31:37 PM9/27/16
to akka...@googlegroups.com
I asked this over on the DDD/CQRS list, but didn't get a reply, so I thought I'd try here.

Imagine a system to notify users about alarms. I'm using Akka Persistence which supports streaming projections from the event store to the read side.

I'm considering three aggregates, (alarm)Definition, Site and User.
Definitions and Users each have a site path which associates them with sites. When a user is opted in we can connect it to accessible sites. When a definition is created or updated, we can connect it to applicable sites.

The definition aggregate may in fact not be needed for notifications, since when an alarm occurs, the occurrence already knows about the site, so navigation could start with that aggregate and dispatch to the opted-in users.

However, the read model may need to support "get users(subscribers) by definition". I could extend the write path so that when a user is opted in it is associated not only with accessible sites, but also with definitions applicable to those sites. Or perhaps the site aggregate coud make the association internally between users and definitions. Either way, that logic would most likely be there solely to support the read model projection. Is that unusual or a red flag of any sort?  

Thoughts?

Renato Cavalcanti

unread,
Sep 29, 2016, 2:36:25 AM9/29/16
to Akka User List
Yes, indeed. I think this question is more suited to the DDD/CQRS group. 

I posted a reaction there. 

Cheers
Reply all
Reply to author
Forward
0 new messages