Working to determine if drools is appropriate for my use case that I plan to migrate from legacy architecture.
- There are about half a million records that I would in simplistic terms consider as rules.
- Each record says who is the customer and if the customer is X and if the incoming real time request has alphanumeric regex strings A or B or C in certain combinations of the fields in request then set some attributes or find and replace some attributes (possibly some external static function to execute such custom logic)
- Multiple such records exists for same customer with different alphanumeric regex string matches and different RHS/Agenda.
- Each record/rule is independent of the other.
I find it excessively complex to manage half a million rules that keeps growing.
Instead I want to create generic rules such as if invokelucenestaticfunction(request.fieldA, config.fieldA) then set request.fieldB = config.fieldB
and the config is stored externally in a database and at the time of firing I pass config and as well as real time request data to rules. So the LHS condition evaluation will need to eval both sides of equations from working memory and in RHS the value to be set is as well passed in working memory. This gives me opportunity to parallelize things.
Alternatively I can have all these half a million records as individual rules but in order to scale rule loading and execution will have multiple peer nodes in my server pool with each node knowing which node has a specific customers set of rules and direct the request to that server. But again if a single customer has 10K rules it still could be a lot.
p.s. forgive my naive rule dsl