Event Sourcing: Towards Clarity

How Event Sourcing helps developers cut through software complexity.

Speaker

Robert Kawecki

"Event Sourcing: Towards Clarity"

2016-04-13

github.com/rkaw92

Event Sourcing

Building applications

application = state + behavior

State mutation

onAuctionOfferPlaced(event) {
	var placedOffer = Offer.unflatten(event.eventPayload.offer);
	this._offers.push(placedOffer);
}

Implementing behavior

Implementing behavior: code

placeOffer(buyer, amount, date) {
	var offer = new Offer(buyer, amount, date);
	if (!this._opened) {
		throw new Error('The auction is not open for offers at this time');
	}
	
	this._stageEvent(new Event('AuctionOfferPlaced', { offer }));
}

Putting it together

Read side: CQRS

Pub-Sub

Advantages

Sources

Thanks!