This is a sample implementation of CQRS / Eventsourcing Infrastructure in node.js using:
- redis for Pub/Sub and Storage.
- node-eventstore for EventSourcing including its redis storage implementation.
- backbone.CQRS to bring CQRS to client with ease.
get it up and running
start redis server
cd redis-x.x.x // make ./src/redis-server
start server in host and domain folder
direct your browser to
the source code is well documented to understand the core principles.
why should i care?
got the sample - where to go now?
As of today i know of three implementations for doing (D)DDD / CQRS in node.js. Building a codebase for production is a whole different thing to doing a little show case / demo code. If it can break - it will break.
This modules are the result of open sourcing parts of a large reallife project of a distributed system based on the principle of DDDD and CQRS. It's gone through a lot of iterations and should address most pitfalls.
- you could find this sample done with adrai's framework at adrai's cqrs-sample
The API is designed well so you can focus on the domain without worring to much about the infrastructure.
Documentation can be found here
Framework for non distributed system using couchDb as storage.
Build web applications based on Domain-driven Design and Layered Architecture.
complete list can be found under node modules
Which one to choose?
If your project is simple enough to be implemented in a traditional way - go for the traditional approach
If your project really profits from doing DDDD / CQRS it might be a good idea to create your own codebase (it's not to complicated, and compared to the overall project size worth the effort as it's the core of your distributed system)
If you need to get fast results and more than a sample - i would try adrai's modules.