Immutable Counter Ledger for Distributed Systems

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Implementing counters and Last-N features in distributed systems is challenging due to the need for atomic, durable, and consistent state changes, which often requires trading off performance, scalability, reliability, and complexity.

Innovation Solution

The system uses a counter ledger with an immutable table for writing counter updates and generates snapshots from the latest counter snapshot and selected counter entries, ensuring atomicity, durability, and consistency while optimizing performance and scalability.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If traditional distributed counter implementations are used to ensure atomicity, durability, and consistency, then reliability is improved, but performance and scalability deteriorate

Engineering Contradiction:
Improvecounter accuracyVSAvoidprocessing throughput
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The system segments counter operations into two distinct phases: (1) asynchronous writes to the counter ledger that do not block, and (2) periodic snapshot generations that consolidate changes. This segmentation allows high-throughput writes while maintaining periodic consistency checks, resolving the contradiction between reliability and productivity.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system performs preliminary actions by maintaining an immutable counter ledger that continuously accumulates counter updates without blocking writes. Snapshot generations are scheduled in advance and execute periodically to consolidate these preliminary changes into consistent states, ensuring reliability without impacting real-time write performance.

Inventive Principle:
Principle #10Preliminary action

2Reliability

If traditional distributed counter implementations are used to ensure atomicity and consistency, then reliability is improved, but system complexity increases

Engineering Contradiction:
Improvestate change consistencyVSAvoidsolution complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The system creates simplified copies of counter states through snapshots that are generated periodically from the immutable ledger. These snapshots provide readable, consistent views of counter data without requiring complex distributed locking mechanisms during read operations, thereby reducing system complexity while maintaining consistency.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The snapshot generation process acts as an intermediary that mediates between the immutable counter ledger and application reads. It consolidates scattered counter updates into coherent snapshot states, simplifying the complexity of ensuring consistency across distributed nodes while maintaining reliability.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Measurement precision

If frequent snapshot generations are performed to improve counter freshness, then measurement precision is improved, but processing overhead increases

Engineering Contradiction:
Improvecounter freshnessVSAvoidprocessing overhead
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The system implements periodic snapshot generation at configurable intervals rather than continuous or frequent snapshots. This periodic action balances counter freshness (measurement precision) with processing overhead by consolidating multiple small updates into periodic batch operations, reducing overall processing energy consumption while maintaining acceptable freshness levels.

Inventive Principle:
Principle #19Periodic action

Solution Approach 2:

Counter updates are preliminarily accumulated in the immutable ledger before snapshot generation. This preliminary accumulation allows the system to process batches of updates together during snapshot creation rather than generating snapshots after each individual update, significantly reducing processing overhead while maintaining counter freshness through periodic consolidation.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS20250156401A1Auto Computation of Counters and Last-N features across High Cardinality Dimensions in Distributed Systems
Publication Date: 2025.05.15 ELASTIC FLASH INC
  • US20250156401A1 patent drawing
  • US20250156401A1 patent drawing
  • US20250156401A1 patent drawing

AI summary

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.