eventsourcing/es4j

Problem: querying for aggregates is expensive

Open

#177 opened on Nov 6, 2016

View on GitHub
 (1 comment) (0 reactions) (0 assignees)Java (27 forks)batch import
enhancementhelp wantedoptimization

Repository metrics

Stars
 (406 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Querying for things like:

  • latest (as in, biggest TIMESTAMP) event for a certain scope (say, reference=R1)
  • sum/avg/max/min for a certain scope (say, reference=R1)

is quite expensive as it involved a lot of scanning (as can be seen in https://github.com/eventsourcing/es4j/blob/master/eventsourcing-queries/src/main/java/com/eventsourcing/queries/IsLatestEntity.java and https://github.com/eventsourcing/es4j/blob/master/eventsourcing-queries/src/main/java/com/eventsourcing/queries/LatestAssociatedEntryQuery.java)

Proposed solution: designate and formalize an aggregate indexing system.

Contributor guide