frmscoe / General-Issues

This repo exists to track current work and any issues within the FRMS CoE
2 stars 0 forks source link

Optimizing Rule Result Caching via Rule List Publication #324

Closed cshezi closed 7 months ago

cshezi commented 7 months ago

Title: Optimizing Rule Result Caching via Rule List Publication

As a Rule Processor (RP) user, I want to optimize the caching process of rule results in the Typology Processor (TP), So that the redundant caching of rule results in Redis for multiple typologies is eliminated, reducing unnecessary Redis requests and improving efficiency.

Scenario: Efficient Rule Result Caching

Given that the Rule Processor (RP) completes its processing and generates rule results.

When the Rule Processor (RP) finishes processing a rule,

Then the Typology Processor (TP) currently sends each rule result individually to every configured typology.

However, this results in each typology independently caching the same rule result object in Redis.

This leads to inefficiency, causing multiple Redis requests for caching the same rule result across different typologies.

Proposal: Optimize Caching Process

As a resolution, this ticket suggests implementing a change in the process:

Expected Outcome: Improved Efficiency

This enhancement will ensure that each rule result is cached only once in Redis, significantly reducing the number of redundant requests sent to Redis for caching purposes.

Acceptance Criteria:

  1. Rule Processor (RP) transmits rule results to the Typology Processor (TP) as usual.
  2. Typology Processor (TP) immediately publishes a Rule List to Redis upon receiving a rule result.
  3. The TP sends an aggregated list of rules for processing to each configured typology instead of individual rule results.
  4. Verify that each rule result is cached only once in Redis despite multiple typologies configured.
  5. Performance testing to validate the reduction in Redis requests and improved efficiency.

Impact Analysis:

Conclusion:

This user story aims to streamline the caching process of rule results by introducing a Rule List publication and sending aggregated rules for processing to typologies, reducing the number of requests made to Redis and optimizing system performance.