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

Mauricio Salatino salaboy at gmail.com
Thu Jun 14 12:21:35 EDT 2012


Yes, you get it right.
Drools Grid (or at least what is there in the source code right now) was
about session virtualization. It allows you to access to a session hosted
in a different JVM.
What you are looking for, I'm afraid is not possible right now, because in
order to distribute one session into multiple JVMs the RETE algorithm needs
to be split. There are some experimental works around this, but nothing has
being released yet. Probably Mark can give you more details about that.
Cheers

On Thu, Jun 14, 2012 at 1:06 PM, chrisLi <shengtao0077 at 163.com> wrote:

> 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.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

 - Salatino "Salaboy" Mauricio -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120614/7b880072/attachment.html 


More information about the rules-users mailing list