We have a system that will have tens of thousands of units. Each block will have 5-10 meters, and each meter will have a value associated with it. The values ββof these counters are changing, and we need a rule engine to be able to respond to these changes in real time.
We will have rules like "if the first meter from unit No. 1 is greater than 10, and the second meter from unit No. 1 is less than 30, then ...", although the rules can be much longer than this, the rules for each block will be completely independent, therefore not there will be rules that determine the values ββof two different meters from two different units.
We will have about 30 rules that are the same for each unit, and then each unit will have about 5-15 user rules. These rules must be added dynamically while the rule engine is running. The unit will probably add 5-10 rules immediately when it is signed, and then add or remove the rule about once a week from this point.
We decided to use Drools for this, and I'm trying to figure out how best to implement it. I'm really new to Drools, so I'm a bit confused. Will it make sense for each unit to have its own knowledge base? If so, is there a way to share rules that are the same for each unit?
I'm worried that we may not have enough memory to store all these rules, so I thought that if we had a knowledge base for each department, we could just serialize all the knowledge bases, put them in the database and get when they we need. Would it be reasonable?
Another reason I thought about using a separate knowledge base for each unit is because the rules of each unit are completely independent of all other unit rules, maybe it was a performance hit to put them all in one knowledge base. Is this correct or is the Rete algorithm smart enough to figure it out?
, ? ? , , ?
, .