[abacus] Refactor Aggregated Usage and Aggregated Rated Usage data model
Saravanakumar A. Srinivasan
Started to look into two user stories( and ) titled "Organize the usage report data model for better querying and DB utilization"
Current state of Abacus processing pipeline starting from Usage Accumulator:
a) Usage Accumulator processes metered usage for a resource instance, accumulates the usage at resource instance scope and then forwards accumulated usage for a resource instance to Usage Aggregator.
b) Usage Aggregator processes accumulated usage for a resource instance, aggregates the usage at following scopes:
organization.spaces.consumers.resources.plans, and then forwards aggregated usage for an organization to Usage Rating Service.
c) Usage Rating Service processes aggregated usage for an organization, rates the aggregated usage at following scopes:
d) Usage Reporting Service processes rated usage for an organization and summarizes usage and charge at all aggregation scopes. See  for a sample Abacus usage report.
Initial thought on changes needed to optimize steps b, c, and d are
b) Usage Aggregator processes accumulated usage for a resource instance and aggregates and rates the usage at a consumer scope - equivalent to the scopes of organization.spaces.consumers.resources and organization.spaces.consumers.resources.plans and then maintains a normalized aggregated usage for an organization that contains references to all consumer scoped documents that belong to the organization.
c) Eliminate Usage Rating Service and split the current rating step across Usage Aggregator and Usage Reporting Service.
d) Usage Reporting Service processes a normalized aggregated usage for an organization, uses references to get all consumer scoped documents that belong to the organization, aggregates and rates consumer scoped usage at all other scopes, and then summarizes usage and charge at all aggregation scopes.
Saravanakumar Srinivasan (Assk),
Bay Area Lab, 1001, E Hillsdale Blvd, Ste 400, Foster City, CA - 94404.
Phone: 650 645 8251 (T/L 367-8251)