Skip to content

Support additive rollups #36

Description

@rahulsom

Currently rollups are computed as

departmentEmployeeJoin
   .computeSnapshot(id, dateOrVersion)
   .flatMap { fromIterator(it.joinedIds) }
   .flatMap { employeeQuery.computeSnapshot(it) }
   .reduce (new DepartmentSummary()) { rollup, snapshot -> ... }

There isn't much potential to do this additively.

If we can do it differently, and this works, we could try this

departmentEmployeeJoin
   .computeSnapshot(id, dateOrVersion)
   .flatMap { getAllEventsForAfterDateOrVersion(it.joinedIds, dateOrVersion) }
   .reduce (new DepartmentSummary()) {rollup, event -> ... }

The challenge is reducing

  1. The number of events fetched
  2. The number of computations performed
  3. The number of scenarios requiring a full recompute

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions