Accurate Global Event Counting Through Immutable Logs and Deduplication
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Distributed computing systems face challenges in accurately counting events from multiple sources in a short time period due to replication latency and inconsistencies in event processing, leading to inaccurate or approximate counts.
Innovation Solution
Implementing a global event counter that maintains an immutable event log and periodically rolls up count values using rollup queues, ensuring accurate counting by deduplicating events through idempotency tokens.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If a leader-follower architecture is used to process events from multiple sources, then the system can handle parallel processing of large volumes of events, but replication latency increases and counting accuracy deteriorates
Solution Approach 1:
The system segments the distributed computing system into multiple regions, each with its own event log and counting mechanism. Follower devices within each region process events locally and maintain independent event logs, eliminating the need for continuous replication to a central leader. This segmentation allows parallel processing across regions while reducing replication latency within each region.
Solution Approach 2:
Follower devices perform preliminary event processing and counting locally before any potential replication to region leaders. Each follower maintains a local event log and computes counts in advance, so that when replication occurs, the counting work has already been done locally. This preliminary action eliminates waiting for replication before counting can occur.
2Adaptability or versatility
If events are replicated from follower devices to region leaders, then event processing can be distributed, but counting accuracy deteriorates due to duplicate or missed events
Solution Approach 1:
The patent introduces region leaders as intermediaries between follower devices and the global system. Each region leader receives events from multiple followers within its region, performs deduplication using event identifiers, and maintains a regional event log. This intermediary layer ensures that duplicate events are filtered out at the regional level before propagating upward, preventing overcounting while maintaining distributed processing.
Solution Approach 2:
Each follower device maintains a local copy of the event log and performs local counting operations. Instead of relying on a single source of truth, the system creates multiple copies of event data across followers and region leaders, with each copy being independently processed and counted. This copying approach ensures that even if some copies are lost or duplicated during replication, the overall count remains accurate through reconciliation mechanisms.
3Speed
If parallel processing is used to handle large volumes of events quickly, then processing speed increases, but counting accuracy deteriorates due to resource strain
Solution Approach 1:
The counting process is segmented into multiple independent counting operations performed in parallel by different follower devices and region leaders. Each segment processes a subset of events independently, maintaining local accuracy through dedicated counting logic. The final global count is obtained by aggregating these independent segment results, preserving accuracy while enabling parallel execution.
Solution Approach 2:
Each follower device and region leader performs self-service counting by maintaining local event logs and computing counts independently without requiring centralized coordination for each counting operation. The system uses self-organizing mechanisms where each component autonomously processes its local events and contributes to the global count, eliminating resource contention and ensuring accuracy through distributed independence.
Data Source
AI summary
In various embodiments, a computer-implemented method comprises receiving, from a first endpoint device, a first event during a first time period, modifying an event log to include a record associated with the first event, causing a rollup queue to include a request to count a first count value associated with the first event, and generating, in a second time period subsequent to the first time period, a counter value associated with at least the first event based on the rollup queue and the event log.


