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

Ensuring writes – multi-node replication

Articles
,

We have gotten the question very often how the multi-node version works with replication. After typing it up about five times in email I figured it might be valuable to do a longer write-up that we can suck into our documentation (and a blog post). One could quite easily put the Event Store Open Source version running on a virtual machine with data storage on a SAN. If the first machine goes wrong for some...


Projections 6: An indexing use case

Tutorials
,

As we went through in Projections 5 : Indexing, the linkTo() function is capable of emitting pointers to another stream. This can allow you to break apart streams in order to change their partitioning and to allow fast indexing. In this post we will look at a use case of how you can use this functionality. I have seen no less than 10 custom auditing systems for nservicebus. Everyone seems to want to build out...


Projections vs RxJS vs etc

Articles
,

There was a pretty good question this morning when I checked comments on posts. “What is the difference between projections and, say, rxjs?” We could as easily include any of the functional reactive libraries out there (bacon.js, flapjax, elm, Rx, etc). We can also start going way back and looking at predecessors like CLM. Let’s start with the similarities both are JavaScript. Both are functional reactive APIs (this is why they look rather similar). They...


Projections 5: Indexing

Tutorials
,

Now we can start getting to some of the interesting things in Projections. It was quite odd, as I was leading up to this post last night we got into a very long discussion about indexing inside the Event Store on twitter. Mike Brown noted that it would be really useful if we built lucene like indexing into the system so he could use the Event Store as an Audit Log that was easily searchable...


Projections 4: Event matching

Tutorials
,

In the “intermission” post we jumped ahead quite a bit in terms of the complexity of the projection we were building. Let’s jump back into our progression of learning bits. The projections we have used so far have used a method called when(). This method allows you to match functions back to types of events. Up until now that has been a single match but you can also use more than one. fromStream('test').when({ Event1: f1,...


Projections (intermission)

Tutorials
,

Yesterday I was meeting with a company. We were going through some of their problems and looking at whether the Event Store and in particular stream querying might be a viable solution to any of their problems. It turned out one of the problems was a perfect example of where projections can make a big project tiny. The Problem People put “Bid Strategies” in through a web application. These strategies are then used for blind...


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...