# Fact Evaluation in Millions: Scalable Rule Executor Service

DevFeed: [Fact Evaluation in Millions: Scalable Rule Executor Service](<https://devfeed.tech/articles/fact-evaluation-in-millions-scalable-rule-executor-service-20136.md>)

Original publisher: [Read original article](<https://medium.com/myntra-engineering/fact-evaluation-in-millions-scalable-rule-executor-service-921a2a19068e?source=rss----7484818e9f88---4>)

Author: Nikhil Anand

Published: 2024-10-01T13:47:49Z

Content type: article

Language: en

Sources: [Myntra](<https://devfeed.tech/sources/myntra.md>)

Topics: [systems](<https://devfeed.tech/topics/systems.md>), [Scalability](<https://devfeed.tech/topics/scalability.md>), [Requirements](<https://devfeed.tech/topics/requirements.md>), [Architecture & Design](<https://devfeed.tech/topics/architecture-design.md>), [implementation](<https://devfeed.tech/topics/implementation.md>)

Tags: [availability](<https://devfeed.tech/tags/availability.md>), [consistency](<https://devfeed.tech/tags/consistency.md>), [frequent-rule-updates](<https://devfeed.tech/tags/frequent-rule-updates.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [latency](<https://devfeed.tech/tags/latency.md>), [performance](<https://devfeed.tech/tags/performance.md>), [requirements](<https://devfeed.tech/tags/requirements.md>), [rule-engine](<https://devfeed.tech/tags/rule-engine.md>), [rules-in-millions](<https://devfeed.tech/tags/rules-in-millions.md>), [scalability](<https://devfeed.tech/tags/scalability.md>), [stateless](<https://devfeed.tech/tags/stateless.md>), [systems](<https://devfeed.tech/tags/systems.md>)

## AI overview

This engineering article describes Myntra's Rule Executor Service, designed to evaluate millions of facts against a similarly large set of rules for multiple tenants. It outlines requirements for scalability, reliability, availability, consistency, low-latency evaluation, dynamic rule management, immediate rule reflection, and fact assessment details.

## Source excerpt

Overview The Rule Executor Service at Myntra stands out as a pivotal tool in the domain of rule engine. While, at a glance, one might wonder what sets it apart from the myriad of rule engines available today, the difference is profound. In Myntra ecosystem, supporting numerous pricing use cases necessitated building a capability that is engineered to handle vast volumes of rules, processing millions of facts against similar scale in terms of rules for multiple tenants with high reliability, performance, availability and consistency. In order for the system to be performant and use as a broker for all Myntra systems preference was given to scalability, and ability to persist and evaluate large large number of rules with low latency evaluation window. Functional & Non-Functional Requirements Let's first delve into the functional and non-functional requirements that necessitate the creation of the Rule Executor Service. Functional Requirements Dynamic Rule Management: The rule engine should be designed with adaptability as a core principle, enabling administrators or users to effortlessly update, introduce, or dynamically remove rules through the user interface as the landscape evolves. Immediate Rule Reflection: Following any changes to the rule set, the rule engine should ensure that all future fact evaluations reflect the latest rule standards with high degree of consistency. Once the creation, updating, or deletion of a rule has been confirmed as successful for the user, no subsequent fact evaluations should be conducted with the outdated rules from that timestamp onwards. This necessitates the updates to be immediately reflected in the knowledge base of the rule engine. Fact Assessment Details: Each evaluated fact should be supplemented with essential details, including the associated rule's ID, name, and description against which it was evaluated. In the absence of configured rules for the provided fact, enrich the fact by incorporating pertinent details regardin