space:event-sourcing The Basics

meteor add space:event-sourcing

This package is a simple implementation of a (non-distributed) version of the DDD + CQRS + Event Sourcing patterns. It provides a base class for event-sourced Aggregates and ProcessManagers as well as serializable ValueObjects to model your business domain.

It also provides a basic implementation of a MongoDB based EventStore which works a little bit different than "normal" event store implementations because MongoDB doesn't support transactions. To circumvent this downside of MongoDB this package uses the concept of a commit which bundles multiple events and commands together into one "transaction" commit. Here is a short blog article talking about the basic concept.

It heavily uses the space-messaging package for Meteor EJSON and runtime-checked domain events and commands that are automatically serialized into the MongoDB and restored for you. So you don't have to deal with serialization concerns anywhere but within your value objects.