# US 2025/0156401 A1 · Auto Computation of Counters and Last-N features across High Cardinality Dimensions in Distributed Systems

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0156401 A1
- Document ID: US20250156401A1
- Status: Published application
- Kind: A1
- Application number: 18/945,371
- Filed: 2024-11-12
- Published: 2025-05-15
- Earliest claimed: 2023-11-09
- Assignees: Elasticflash, Inc.
- Applicants: Elasticflash, Inc.
- Inventors: Darshan Bharatkumar Rawal; Naoki Iwakami; Pradeep Jnana Madhavarapu
- Web page: https://patentgrep.com/patent/US20250156401A1

## CPC

- G06F 16/2379: {Updates performed during online database operations; commit processing}
- G06F 16/2264: {Multidimensional index structures}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Systems and methods for computing counters in a distributed system are described. One embodiment includes receiving a counter update request, that includes at least one counter entry each including a timestamp, an operation value, a first set of dimension values, and at least one counter value, writing to a counter ledger, where the counter ledger comprises an immutable table where each entry has a first timestamp, an operation, a first set of dimensions, and a first at least one counter state, each counter state restricted to numeric values, reading a latest counter snapshot from an immutable snapshot ledger, generating a new counter snapshot from the latest counter snapshot and selected counter entries in the counter ledger, where the new counter snapshot includes the second set of dimension values, a second timestamp, at least one snapshot counter value, writing the new counter snapshot to the snapshot ledger.

## Claims

### Claim 1

A counter server, comprising:
a processor;
a network interface;
non-volatile memory comprising:
a counter ledger comprising an immutable table where each entry includes values for fields of:
a first timestamp;
an operation, where the available values for the operation include at least “delta” and “set”;
a first plurality of dimensions, each dimension restricted to values having a particular data type; and
a first at least one counter state, each counter state restricted to values that are numerical;
a counter analytics application that, when executed, instructs the processor to:
receive a counter update request, where the counter update request includes at least one counter entry that each includes a timestamp, an operation value, a first plurality of dimension values, and at least one counter value;
write the at least one counter entry to the counter ledger;
reading a latest counter snapshot from an immutable snapshot ledger, where the latest counter snapshot has the most recent timestamp of counter snapshots in the snapshot ledger;
select counter entries from the counter ledger for compaction given a second plurality of dimension values, where the counter entries are selected by having dimension values matching those of the second plurality of dimension values and having a timestamp after the time of the latest counter snapshot;
generate a new counter snapshot from the latest counter snapshot and the selected counter entries in the counter ledger at a predefined time interval, where the new counter snapshot includes:
the second plurality of dimension values;
a second timestamp taken from the most recent timestamp of the selected counter entries;
at least one snapshot counter value, where each snapshot counter value is calculated from corresponding counter state values of the selected counter entries and the latest counter snapshot;
write the new counter snapshot to the snapshot ledger.

### Claim 2 (depends on 1)

The counter server of claim 1, wherein the counter analytics application further instructs the processor to generate a second new counter snapshot at a next time interval.

### Claim 3 (depends on 1)

The counter server of claim 1, wherein the counter analytics application instructs the processor to generate entries for a second snapshot ledger having less frequency of the snapshot ledger by:
selecting counter snapshot entries from the snapshot ledger that fall within a larger time interval than the predefined time interval;
compacting the selected counter entries for each larger time interval by summing the snapshot counter values for each counter state; and
writing at least one second counter snapshot entry to the second snapshot ledger having the summed snapshot counter values and the timestamp of the latest selected counter snapshot entry.

### Claim 4 (depends on 1)

The counter server of claim 1, wherein the counter analytics application instructs the processor to perform compaction to generate a first set of counter snapshots including a first dimension and a second set of counter snapshots including the first dimension and a second dimension by:
compacting a plurality of counter entries that match dimension values for the first dimension and the second dimension to generate the set of second counter snapshots;
compacting counter snapshots from the second set of counter snapshots that match the first dimension to generate each of the first set of counter snapshots.

### Claim 5

A counter server, comprising:
a processor;
a network interface;
non-volatile memory comprising:
a counter ledger comprising an immutable table where each entry includes values for fields of:
a first timestamp;
an operation, where the available values for the operation include at least “delta” and “set”;
a first plurality of dimensions, each dimension restricted to values having a particular data type; and
a first at least one counter state, each counter state restricted to values that are numerical;
a counter analytics application that, when executed, instructs the processor to:
receive a counter snapshot request from a client device, where the counter snapshot request includes at least a first plurality of dimension values;
when the counter snapshot request does not include an “on the fly” flag:
read a latest counter snapshot from an immutable snapshot ledger, where the latest counter snapshot has the most recent timestamp of counter snapshots in the snapshot ledger;
send the latest counter snapshot to the client device;
when the counter snapshot request includes an “on the fly” flag:
reading a latest counter snapshot from a snapshot ledger, where the latest counter snapshot has the most recent timestamp of counter snapshots in the snapshot ledger;
select counter entries from the counter ledger for compaction given a second plurality of dimension values, where the counter entries are selected by having dimension values matching those of the second plurality of dimension values and having a timestamp after the time of the latest counter snapshot;
generate a new counter snapshot from the latest counter snapshot and the selected counter entries in the counter ledger at a predefined time interval, where the new counter snapshot includes:
the second plurality of dimension values;
a second timestamp taken from the most recent timestamp of the selected counter entries;
at least one snapshot counter value, where each snapshot counter value is calculated from corresponding counter state values of the selected counter entries and the latest counter snapshot;
send the new counter snapshot to the client device.

### Claim 6

A method for maintaining counters in a distributed system, the method comprising:
receiving a counter update request, where the counter update request includes at least one counter entry that each includes a timestamp, an operation value, a first plurality of dimension values, and at least one counter value;
writing the at least one counter entry to a counter ledger, where the counter ledger comprises an immutable table where each entry includes values for fields of:
a first timestamp;
an operation, where the available values for the operation include at least “delta” and “set”;
a first plurality of dimensions, each dimension restricted to values having a particular data type; and
a first at least one counter state, each counter state restricted to values that are numerical;
reading a latest counter snapshot from an immutable snapshot ledger, where the latest counter snapshot has the most recent timestamp of counter snapshots in the snapshot ledger;
selecting counter entries from the counter ledger for compaction given a second plurality of dimension values, where the counter entries are selected by having dimension values matching those of the second plurality of dimension values and having a timestamp after the time of the latest counter snapshot;
generating a new counter snapshot from the latest counter snapshot and the selected counter entries in the counter ledger at a predefined time interval, where the new counter snapshot includes:
the second plurality of dimension values;
a second timestamp taken from the most recent timestamp of the selected counter entries;
at least one snapshot counter value, where each snapshot counter value is calculated from corresponding counter state values of the selected counter entries and the latest counter snapshot;
writing the new counter snapshot to the snapshot ledger.
