petrjanda / node-cqrs Goto Github PK
View Code? Open in Web Editor NEWNode.js implementation of CQRS.
Node.js implementation of CQRS.
View is the representation of read model in the system. Currently it encapsulate two basic concepts: view building and view reading. After recent updates, we are able to separate those concerns, thus we would have one component responsible to build the view data (orchestrated by denormalizer) and other much simpler component to read it.
In order to significantly speedup view fetching, need to implement better way how to store denormalized data in the smaller chunks. Currently each view is stored as separate document (unique key) but we need to implement much better granularity (by different rules).
Example: View with list of events for multiple users in a time
Instead of storing one big bulk and then fetching just part of the view on the app level, we would store view per day and user. This would mean fetching data for particular day and user would be way faster.
The strategy how to split data should be easy to change.
events = events.sort(function(a, b) {
return a.time > b.time ? 1 : -1;
});
In order to make it easier to rebuild structural data view in the application, we need a simple way to purge snapshots for a given view / aggregate.
CouchDB is not very good in generating sequences. Instead each id is random generated string. It makes it a bit difficult to order the events then. The easies way is to order by time when event was created, although in some apps, there can be multiple events coming at same mili-second.
Luckily there are solutions in node.js to work with microseconds, thus orders of magnitude more precise solution.
View is the representation of read model in the system. Currently it encapsulate two basic concepts: view building and view reading. After recent updates, we are able to separate those concerns, thus we would have one component responsible to build the view data (orchestrated by denormalizer) and other much simpler component to read it.
i want use cqrs at npmjs , can i?
i develop a new cqrs domain project, i like cqrs
name.
npm install cqrs
can i use it? make to me?
To speedup aggregate reconstruction, snapshots need to be supported:
https://github.com/petrjanda/node-cqrs/blob/master/lib/repository.js
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.