In my previous project, the cache had to support PnL aggregation by account or by product type (US aviation stock or high-yield bonds etc). I didn’t find out how it was implemented. How is it done in a typical Coherence system?
In fact, the accounts exist in a hierarchy. For example, individual accounts belong to an office. Each office belongs to a region. Each region belongs to a legal entity…. Similarly, the products are organized in a hierarchy too. PnL is first computed at position level. How are these individual position PnL aggregated in Coherence?
Answer 1 — http://coherence.oracle.com/display/COH35UG/Processor+Example is the recommended solution by some practitioners. Basically, api-users write 2 classes — a filter and a processor. Filter controls the subset of data entries or you may say the “universe”. Processor does the aggregation. Internally, I was told an aggregation loop is unavoidable.
I feel coherence data entries are organized into maps along with auxiliary lookup tables to support predicate-assisted select queries like “where account.country = UK”.
Answer 2 — http://docs.oracle.com/cd/E18686_01/coh.37/e18677/toc.htm also mentions an EntryAggregator.