I’m going to build a greenfield SaaS project that seems suited for Event Sourcing and CQRS. I’m going to use NodeJS to expose a Restful API to the AngularJS client. I’m read a lot about Event Sourcing from Greg Young, but I have no experience in this area.
What are the advantages/disadvantages of using EventStore (http://geteventstore.com) over implementing event sourcing in MongoDb?
Also, I cannot find good information on the best way to get data from the Event Source to the Read model (or eventual consistency) – and then get that updated data back to the client. On twitter James Nugent suggested it’s better to use the event store as a queue, but I’m not sure how this would work.
And guidance using the Atom API with NodeJS would be great.
Is there a simple, complete, example showing how all this works with NodeJS?
So a simple question. How will you do the following with mongo:
Write and read events to/from streams with ordering etc
Then:
Your projections don’t want to read from streams in the same way they were written, projections are normally interested in event types and want all events of type t regardless of stream written to and in proper order.
This would seem to be a nontrivial task on mongodb
Thanks for the feedback Greg. I think you answered the question with a question – and that makes sense for my first question – thank you. But what of the remaining questions? And the most important question I suppose, is there a resource/how-to for @GetEventStore and @NodeJS?
Running a database in a worker role is VERY bad idea (though it may be technically possible) - you have very few guarantees about where, what and how your instances will get moved.
If you want to use Event Store in Azure you’ll want to be using it in VMs instead - several customers are doing that, but it can require some specialised configuration to make the storage perform well enough (e.g. changing the memtable-ptable crossover to avoid
having to pull large chunks from storage a long way away). This is true of basically any database though, or anything with heavy storage requirements.