I have a collection of "business-process" documents and a separate collection of "business-process-events", each with a property business-process-id as a reference to the business-process of the event. Both documents are immutable to avoid concurrency issues, at least that is the idea so far.
I need to perform queries and show business-processes in a read-only "grid" with supplemental data based on a lot of logic from the business-process-events that has occured. Business-process-events can be stored out of order, especially
I thought about using map-reduce, but from past experience and available documentation, it will not be possible to do enough complex logic in the reduce.
If it was possible to subscribe to all new business-process-events and update a new index based on all business-process-events for the business-process at that point it would probably be a good solution, but how?