[rules-users] Is a single StatefulKnowledgeSession with Distributed Memory cache possible?

chrisLi shengtao0077 at 163.com
Thu Jun 14 12:06:50 EDT 2012


Hi All,

     I am working on a banking fraud detection project with Drools Fusion,
which will match a transaction against hunreds of rules to check whether the
transaction is suspicious.
     
     In some rules, I use time-based sliding window to calculate the average
transaction amount of an account in the past 3 or 6 months. One possible
rule will be as below:

    rule "Single Large Amount Transaction"
    dialect "mvel"
    when
        $account : Account($number : number)
        $averageAmount : BigDecimal() from accumulate(
            TransactionCompletedEvent(fromAccountNumber == $account.number,
$amount : amount)
            over window:time(90d)
            from entry-point TransactionStream,
            bigDecimalAverage($amount))
        $t1 : TransactionCreatedEvent(fromAccountNumber == $account.number,
            amount > $account.creditAmount * 0.5, amount > $averageAmount *
3.0)
           from entry-point TransactionStream
    then
    end

    In such cases, the Fusion Engine will hold TransactionCompletedEvent in
its memory for 90 days. And we have about 1 billion Accounts in total, so
the TransactionCompletedEvent will be huge, we will very soon run out of
memory.

    I have been blocked here for a long time! Is it possible to distribute a
single StatefulKnowledgeSession in multiple JVMs or machines using
Distributed Memory cache such as Hazelcast? If yes, could you give me some
opinion on the solution? Or is this the problem the Drools Grid project try
to handle? Or there are other techonology to handle large numbers of facts
or events problem?

    As far as I know, Drools Grid distribute multilple ksessions on multiple
machines in the Grid, each or several kseesions on one node? Is my
understandings right?
 
    Any response or opinion from you will be appriciated! Thank you very
much!   

--
View this message in context: http://drools.46999.n3.nabble.com/Is-a-single-StatefulKnowledgeSession-with-Distributed-Memory-cache-possible-tp4017968.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list