trimming repositroy

It appears that AggregateDeletedEvent does not delete the aggregate
from the repository; it simply marks it as 'deleted'. Is there a way
to physically remove an aggregate from the repository? Without the
removal of aggregates, the repository would continue to grow? Is there
an way to trim the repository, say, the data for all aggregates, older
than 30 days would be removed.

Thanks in advance.

Hi Jamil,

which type of repository are you refering to? ORM Repositories will actually delete the aggregate. An Event Sourced repository will not delete an aggregate, since Event Stores are generally append only.

Are you worried about the Event Store’s size? Howmany events do you expect to store?

Cheers,

Allard

Allard,

I was referring to event-sourced repository. I would have a few
million aggregate objects. Each of these aggregates would produce 3-4
events, on a daily basis, continuously. At this rate, event store's
size would become quite large after a few weeks. A built-in support
for removal of old events would be welcome.

Thanks.

Jamil

If you don't care about the events, what is your motivation to use event sourcing?

Cheers,

Allard

Allard,

If I understand correctly, If I don't use event-sourcing, I don't have
aggregate classes. In this case, the command handler would publish
events to the event bus. It is not clear to me how I would publish
events in the absence of the 'apply' method that comes with
AbstractAnnotatedAggregateRoot class. Is the sample code where event-
sourcing is not used?

Thanks,

Jamil

Hi Jamil,

event sourcing is just one way of storing aggregates. It is perfectly possible to store aggregate using “plain old” ORM, with JPA for example. If aggregates want to publish events in such mapping, you would use the “registerEvent” method on the AbstractAggregateRoot.

I think the axon-trader sample contains an aggregate that is not stored using Event Sourcing.

Cheers,

Allard

Allard,

I got it figured out; thanks for your help.

Jamil