Deriving events schema from aggregate schemas

49 views
Skip to first unread message

Pierre

unread,
Jul 21, 2016, 5:23:17 AM7/21/16
to DDD/CQRS
Hello,

My team and I are developing a prototype for a software with an Event Sourcing architecture. We use a schema-less database (Couch) but verify the format of the document posted with a JSON schema validation. This ease operation like reducing the data, ensuring consistency. Every events and aggregates has a JSON schema.

Would it be possible to derive the necessary events schema from the aggregate? Are there any already existing solution or literature on the subject?

Thanks in advance,
P.

emragins

unread,
Jul 22, 2016, 2:21:20 AM7/22/16
to DDD/CQRS
Newbie here.

I can't imagine how such a thing would work and still have value from a business standpoint.

The idea of aggregates is to have a rich domain model, and anything which would derive schema/events off those aggregates would basically amount to CRUD. If that's the goal, then it's probably better to forego event sourcing in favor of CRUD since the real benefits of ddd/es would be lost but you'd still have the added complexity.

Modeling your events should be core to modeling your business.

Reply all
Reply to author
Forward
0 new messages