Tutorials - page 2

Free step-by-step tutorials and how-to guides for a range of event sourcing projects, from how to get started with event sourcing to specific use-cases with example code.

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


Using JS projections from the browser

Tutorials
,

One of the main use cases we had for using Javascript as our query language was that the same code could be hosted in a browser. You can see a more in depth example of this in the “Event store chat example” that is reachable from the main screen in the management console. Sometimes code speaks 1000 words. <!doctype html> <html> <head> <title>Simple Chat</title> <script src="lib/jquery/jquery-1.8.0.min.js"></script> <script src="js/projections/v8/Prelude/Modules.js"> </script> <script src="js/projections/v8/Prelude/Projections.js"> </script> <script src="js/projections/es.projections.environment.js"> </script>...


Amazon EC2

Tutorials
,

We went through the process last night of setting up Amazon EC2 nodes with the Event Store running on them. This post is a quick tutorial of how to do it. First when setting up your node add to the security group (we did a t1.micro running ubuntu 12 to start with). 22 (SSH) 0.0.0.0/0 1113 0.0.0.0/0 2113 0.0.0.0/0 Now bring up your node. The first thing that you will need to get is mono....