Asynchronous Rule Compilation for Multi-Tenant Rule Engines
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional business rules engines suffer from high latency and resource intensity due to synchronous compilation and execution, which is exacerbated by large rule sets, leading to inefficient rule validation and execution processes.
Innovation Solution
Implementing asynchronous rule compilation in a multi-tenant environment, where compilation and execution occur on separate threads, utilizing a guided rules editor driven by organization metadata to reduce validation errors and enhance efficiency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If synchronous compilation and execution is used in conventional rules engines, then rule validation and execution can be performed in a single process, but compilation time and resource consumption increase significantly
Solution Approach 1:
The patent divides the rule processing workflow into distinct segments: rule authoring/definition, rule compilation, and rule execution. By separating compilation from execution and allowing them to occur independently in different threads, the system eliminates the synchronous bottleneck where execution had to wait for compilation to complete, thereby improving overall productivity without sacrificing validation thoroughness
Solution Approach 2:
The system performs rule compilation in advance as a preliminary action before execution is needed. Compiled rules are stored and validated beforehand, allowing the execution thread to directly use pre-compiled rule sets without waiting for compilation during runtime. This preliminary compilation action significantly reduces the time loss during rule execution
2Reliability
If large rule sets are compiled synchronously, then complete rule validation can be achieved, but memory consumption and processing time increase
Solution Approach 1:
The patent implements segmentation by separating the validation process into two phases: structural validation during compilation (when the complete rule set is available) and operational validation during execution (when individual rules are applied). This allows comprehensive validation without requiring all rules to be loaded into memory simultaneously during execution, reducing memory consumption while maintaining validation reliability
Solution Approach 2:
The patent introduces a rule compiler as an intermediary component between rule authoring and rule execution. The compiler validates rules structurally and compiles them into an optimized format for execution. This intermediary handles the memory-intensive validation work separately, allowing the execution engine to operate with lower memory requirements while maintaining complete validation accuracy
3Reliability
If compilation is performed before each execution, then rules are always up-to-date, but latency increases due to repeated compilation
Solution Approach 1:
The system performs rule compilation as a preliminary action that occurs once when rules are authored or modified, rather than repeatedly before each execution. The compiled rules are stored in a validated format that can be directly executed without re-compilation. This preliminary compilation ensures rules are current while eliminating repeated compilation latency during execution
Solution Approach 2:
The patent implements dynamic rule management where the system adapts its compilation behavior based on whether rules have changed. When rules are modified, the system dynamically re-compiles only the affected rules. When rules remain unchanged, the system directly uses previously compiled rules without re-compilation. This dynamic approach maintains rule currency while minimizing unnecessary compilation latency
Data Source
AI summary
Implementation of a guided rules editor includes a rule compilation process comprising receiving, by an event handler, a compile rules event from a process external to the rule compiler. A set of rules is retrieved from a database and loading the set of rules into a memory by the event handler. Responsive to identifying any template rules, data is bound to the template rules. Both the template rules and any non-template rules are translated into a rules language specification. A rule compilation process is performed asynchronously from a rule execution process to translate the rule language specification into a knowledge base that is to be used as input by a rule execution process. A compile completion event is emitted at compile completion.


