Event Store blog - Posts in Event sourcing - Page 2 of 2

Projections 3: Using state

Tutorials
,

In Projections 2 we looked at creating a very simple projection that would analyze our statistics inside of the Event Store. The projection was: fromStream('$stats-127.0.0.1:2113'). when({ "$statsCollected" : function(s,e) { var currentCpu = e.body["sys-cpu"]; if(currentCpu > 40) { emit("heavycpu", "heavyCpuFound", {"level" : currentCpu}) } } }); This is a very common type of scenario we will find in event based systems. We can describe this as: “When this event happens and this information is on...


Projections 2: a simple SEP projection

Tutorials
,

In the first post on projections we talked a bit about the theory behind projections. In this post we are going to try to create a very simple projection and talk about how it actually works. To start with there is a very special stream inside of the event store. This stream represents statistics measurements that are happening internally. You can control how often they are taken via config. To find this stream in your...


Projections 1: Theory

Tutorials
,

Over at eventstore.com we have 1.0’d the Event Store database as an Event Store (i.e. storing/retrieving events/multinode version/etc) but in the process we did not release projections. They are still marked as experimental. Projections are however getting close to ready so its time to write a bit about them as the official documentation takes shape. Through the series we will get fairly deep into their usage but for many the best way to understand them...