Yes, that's another option too.. it really depends on how you can accumulate data or split your data to be analyzed.<div>Cheers<br><br><div class="gmail_quote">On Thu, Jun 14, 2012 at 1:22 PM, Vincent LEGENDRE <span dir="ltr"><<a href="mailto:vincent.legendre@eurodecision.com" target="_blank">vincent.legendre@eurodecision.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">May be you can think differently : Instead of keeping all objects for 90 days, keep only the accumulate results for each previous day.<br>
<br>
----- Mail original -----<br>
De: "chrisLi" <<a href="mailto:shengtao0077@163.com">shengtao0077@163.com</a>><br>
À: <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
Envoyé: Jeudi 14 Juin 2012 18:06:50<br>
Objet: [rules-users] Is a single StatefulKnowledgeSession with Distributed Memory cache possible?<br>
<div class="HOEnZb"><div class="h5"><br>
Hi All,<br>
<br>
I am working on a banking fraud detection project with Drools Fusion,<br>
which will match a transaction against hunreds of rules to check whether the<br>
transaction is suspicious.<br>
<br>
In some rules, I use time-based sliding window to calculate the average<br>
transaction amount of an account in the past 3 or 6 months. One possible<br>
rule will be as below:<br>
<br>
rule "Single Large Amount Transaction"<br>
dialect "mvel"<br>
when<br>
$account : Account($number : number)<br>
$averageAmount : BigDecimal() from accumulate(<br>
TransactionCompletedEvent(fromAccountNumber == $account.number,<br>
$amount : amount)<br>
over window:time(90d)<br>
from entry-point TransactionStream,<br>
bigDecimalAverage($amount))<br>
$t1 : TransactionCreatedEvent(fromAccountNumber == $account.number,<br>
amount > $account.creditAmount * 0.5, amount > $averageAmount *<br>
3.0)<br>
from entry-point TransactionStream<br>
then<br>
end<br>
<br>
In such cases, the Fusion Engine will hold TransactionCompletedEvent in<br>
its memory for 90 days. And we have about 1 billion Accounts in total, so<br>
the TransactionCompletedEvent will be huge, we will very soon run out of<br>
memory.<br>
<br>
I have been blocked here for a long time! Is it possible to distribute a<br>
single StatefulKnowledgeSession in multiple JVMs or machines using<br>
Distributed Memory cache such as Hazelcast? If yes, could you give me some<br>
opinion on the solution? Or is this the problem the Drools Grid project try<br>
to handle? Or there are other techonology to handle large numbers of facts<br>
or events problem?<br>
<br>
As far as I know, Drools Grid distribute multilple ksessions on multiple<br>
machines in the Grid, each or several kseesions on one node? Is my<br>
understandings right?<br>
<br>
Any response or opinion from you will be appriciated! Thank you very<br>
much!<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Is-a-single-StatefulKnowledgeSession-with-Distributed-Memory-cache-possible-tp4017968.html" target="_blank">http://drools.46999.n3.nabble.com/Is-a-single-StatefulKnowledgeSession-with-Distributed-Memory-cache-possible-tp4017968.html</a><br>
Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br> - MyJourney @ <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a><div> - Co-Founder @ <a href="http://www.jugargentina.org" target="_blank">http://www.jugargentina.org</a><br>
- Co-Founder @ <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br> <br> - Salatino "Salaboy" Mauricio -</div><br>
</div>