Auto-Expiring Multi-Tenant Event Counters With Sliding Windows
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current CRM systems face inefficiencies in tracking event counters for workflow automations across multiple tenants and entities, leading to increased computational overhead, data storage requirements, and time-consuming aggregate queries, especially when accounting for different time zones.
Innovation Solution
Implement a multi-tenant multi-entity sliding window event counter using a key value store with dynamic keys and auto-expiry capabilities, where each tenant's events are tracked with a hash structure that includes entity IDs and execution counts, automatically cleaning up after a predefined period.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If a time series table is used to track event counters, then event tracking capability is improved, but data storage requirements and computational overhead increase
Solution Approach 1:
The patent extracts only the essential counting functionality from a full time series database, using a key-value store to store only aggregated event counts rather than individual event records. This eliminates the need to store unnecessary detailed event data while maintaining the ability to track and aggregate event counters efficiently.
Solution Approach 2:
The patent uses ephemeral key-value stores with automatic expiration settings to store event counter data. These temporary storage structures automatically delete old data after a predefined period, eliminating the need for long-term data retention and manual cleanup processes while maintaining accurate sliding window counters.
2Reliability
If a time series table is used to track event counters, then event tracking capability is improved, but query performance deteriorates
Solution Approach 1:
The patent performs preliminary aggregation of event counts at the time of each event occurrence, maintaining running totals in the key-value store. When aggregate queries are executed, the system simply retrieves pre-computed counts rather than querying and aggregating individual event records, dramatically improving query performance.
3Quantity of substance
If a key value store is used to track event counters, then storage efficiency is improved, but time zone handling capability deteriorates
Solution Approach 1:
The patent makes the key-value store adaptive to different time zones by dynamically constructing keys that include tenant-specific time zone information. Each tenant's event counters are stored with keys that encode their local time zone context, allowing the same key-value store infrastructure to efficiently handle multiple time zones without requiring programmatic key construction tweaks.
Data Source
AI summary
A computer-implemented method performing an auto expiring multi-tenant multi-entity sliding window event counter includes defining a dynamic key for a key value pair uniquely created for a tenant per day in any key value store. The method also includes storing a hash associated with the dynamic key. The hash includes an entity identification (ID) as a key and an event count as a value, and upon a valid event for an entity of the tenant, identifying a tenant level key for a day and incrementing the value of the entity ID. The method further includes retrieving a sum of counts over the predefined period of time for each entity identified with the entity ID for the tenant, and performing automated key deletion/cleanup after expiration of the predefined period of time set as expiry for the key.


