Event Reporting

I’m using NServiceBus for all kinds of event publishing from various service boundaries. We have a need to do Reporting work on all this disparate events. Is the Event Store a proper tool for doing reporting on these events if I have a reporting endpoint that listens to say 100 different event types and stores them within the event store? If yes, how? can I do projections on different event types correlated by some id?


I was actually chatting with Udi about this yesterday (how useful the
ES can be to dump the NSB audit log into).

The first projection I would make is

fromAll().whenAny(function(s,e) { link_to(e.correlationId, e); });

this will take the audit log being written an index it based upon
correlation id. EG: yourdomain/streams/{correlationid} gives you an
atompub of all the events from within that correlationid. As its
atompub its also browsable with just chrome or internet explorer.

I would also consider doing indexes for service/event type/user
depending how your system is setup.



Thanks Greg. Makes sense. I’ve had people within my group question the need for the event store and brought up NoSql solutions with map/reduce or even some data warehousing store. Can you give me some ammunition to combat these propositions and what to what to watch out for?

It works continuously. Your queries are denotmalizations. Any query can be done this way.

At any point the query is essentially o(1) instead of a map reduce.

Also I find one of the first thing people would do is write a custom API for actually viewing their events (atompub gives this for free)

If all you want is basic correlation I’d mapping it doesn’t make too much difference but beyond that it can make a big difference.


So you’re saying if you set up a specific projection, as soon as the event is appended/inserted, projection automatically runs and creates a denormalized view to be queried?

Yes exactly. Under reasonable load. As load increases (say a few thousand per second it’s sla will go down)

Perfect. By the way, I saw a different post related to multi-tenancy and we are also super interest in such a scenario where we hope it works something similar to RavenDb (albeit a diff technology) where you have the same instance of EventStore running but the data goes into each tenant’s ES. We do not have requirements of separating file systems and low level stuff, more in terms of simply a separate ES within same instance (assuming that even applies to ES)

If files are not a worry just prefix the stream names eg client1-foo

Nice. Thanks for super prompt responses. We will start evaluating.