Usage record aggregation
AssigneeStripe, Inc.
InventorsAlisa (Shuhui) He, Tushar Dhoot, Ji Huang
Life of this patent
Estimating the term…
Abstract
In an example embodiment, a solution is provided that aggregates records as they are submitted to a third party (on the write path) rather than performing a real-time aggregation when a request is processed that needs the aggregation (read path). More particularly, in an example embodiment, a caching layer is introduced that avoids having to read all usage events to compute an aggregation when a request is received for aggregated data. The caching layer maintains values for various metrics that require aggregation.
Claims20
A method comprising:
- receiving, by one or more processors coupled to non-transitory memory, a first usage record from a first customer system, the first usage record indicating an identification of a first user associated with the first customer system and a quantity of usage of a first unit of measure that occurred during a first predefined time period;
- storing, by the one or more processors, the first usage record in a first database;
- determining, by the one or more processors, that a usage record aggregation data structure instance exists that uniquely corresponds to both the first user and the first predefined time period, the usage record aggregation data structure instance indicating that usage records of the first user corresponding to the first predefined time period are to be aggregated;
- upon determining that the usage record aggregation data structure instance exists, aggregating, by the one or more processors, quantities of usage of the first unit of measure from all usage records, in the first database, that correspond uniquely to both the first user and the first predefined time period;
- calculating, by the one or more processors, one or more aggregation metrics based on the aggregated quantities;
- and
- storing, by the one or more processors, the one or more aggregation metrics in a caching layer, along with the identification of the first user and an indication of the first predefined time period.
A system comprising:
- one or more processors;
- and
- a non-transitory memory storing instructions that, when executed by at least one processor among the one or more processors, cause the at least one processor to perform operations comprising:
- receiving a first usage record from a first customer system, the first usage record indicating an identification of a first user associated with the first customer system and a quantity of usage of a first unit of measure that occurred during a first predefined time period;
- storing the first usage record in a first database;
- determining that a usage record aggregation data structure instance exists that uniquely corresponds to both the first user and the first predefined time period, the usage record aggregation data structure instance indicating that usage records of the first user corresponding to the first predefined time period are to be aggregated;
- upon determining that the usage record aggregation data structure instance exists, aggregating quantities of usage of the first unit of measure from all usage records, in the first database, that correspond uniquely to both the first user and the first predefined time period;
- calculating one or more aggregation metrics based on the aggregated quantities;
- and
- storing the one or more aggregation metrics in a caching layer, along with the identification of the first user and an indication of the first predefined time period.
A non-transitory machine-readable medium comprising instructions which, when executed by one or more processors, cause the one or more processors to perform operations comprising:
- receiving a first usage record from a first customer system, the first usage record indicating an identification of a first user associated with the first customer system and a quantity of usage of a first unit of measure that occurred during a first predefined time period;
- storing the first usage record in a first database;
- determining that a usage record aggregation data structure instance exists that uniquely corresponds to both the first user and the first predefined time period, the usage record aggregation data structure instance indicating that usage records of the first user corresponding to the first predefined time period are to be aggregated;
- upon determining that the usage record aggregation data structure instance exists, aggregating quantities of usage of the first unit of measure from all usage records, in the first database, that correspond uniquely to both the first user and the first predefined time period;
- calculating one or more aggregation metrics based on the aggregated quantities;
- and
- storing the one or more aggregation metrics in a caching layer, along with the identification of the first user and an indication of the first predefined time period.
Dependencies are inferred from the claim text.