When creating a projection using the JavaScript API in eventstore, how large can the state object become? Is this limited to the amount of memory on the machine or is this saved to disk? I would think the later would be more impactful in terms of how large of a state you could hold.
2
votes
Good question. I have mine running on a machine with 2GB (Ubuntu) and it only wanted about 700mb before I dumped data and projections on to it. I dumped 100k aggreagtes with about 10 events in each, with all projectsion turned on. It consumes 900mb now. I am not sure what any of that means but probably worth just running a console app for a day creating a few billion aggreates and streams and trying to hammer it and see what the latency, ram and IO is like?
- Piotr Kula
1 Answers
1
votes
In the ideal world projection should be as small as possible and really small. If you need several bunches of data - use several projections. This is the right way to simple scaling (in the worst case - one node - one projection).
Also, I suggest deciding about data type you want to store. IMHO, projection in event-sourced system should be organized document-oriented - in this case, projection will be small.
If you want to store GBs of info, in any case, use so db as projection. In theory, it's ok, on practice you'll create another one abstraction (adapter) to work with different projection types. This concept you can investigate in resolvejs framework.