8

i have to achieve an application with drools but, it appears that DROOLS can not reason over a big number of objects simultaneously. i want to know if it could reason over data stored in a relational database and not in the workingMemory.

thanks for any help :)

fennou
  • 95
  • 1
  • 5
  • Kind of related: http://stackoverflow.com/questions/8509993 – Tomasz Nurkiewicz Apr 03 '12 at 11:05
  • Do you want Drools to persist data, instead of being fully in-memory? And to transparently reason over a persistence layer and save results back to it? – Jesvin Jose Apr 04 '12 at 06:24
  • 1
    yes this is what I actually want, because it appears that the WM dosen't supporte a very large volume data in.:)please forgive my broken english:) – fennou Apr 04 '12 at 09:30

1 Answers1

5

Your question is quite broad. The answer is in order to reason over data, unless you are working with stored procedures, any application (drools or not) will need to load the data into the JVM. The data can then, in a Drools application, be inserted into the working memory (please note that this does not cause any copy operations as drools works with standard application POJOs as facts) or it can be fetched on-demand by rules using the "from" conditional element. Hibernate also uses POJOs and Drools has no problems working with them.

"DROOLS can not reason over a big number of objects simultaneously"

Not sure what you mean by that? how much is a big number? I personally worked with a few drools applications that used over a million facts simultaneously in each instance of the working memory, with average response time for rule execution in the 100s ms order. Here you can see a presentation of a consultant that worked on a project where rules had to query and reason over historical data of over 30 million records in real time: http://vimeo.com/27209589 . He used a noSQL database for that.

Large applications will require more care while designing the architecture, of course, but this is true for Drools as well as for any technology. If you detail your use case, we can give you more specific advice. Also recommend checking the Drools mailing list as there are a ton of good advice for application design there.

Hope it helps to clarify.

Edson Tirelli
  • 3,891
  • 20
  • 23
  • 1
    thanks for your response. here are some details.i'm working on a banking fraud detection application , and as you know for a given bank , hundreds of thousands transactions are done every day (may be millions). what i want to do is, in the end of every day ,give those objetcs (transactions) to drools (put them in the working memory) and some historical data concerning bank's customers (hundreds of thousands or million) and wait for drools's response., but what i get is : -a very slow response time. -outofmemoryerror java heap space. thanks for your help :) :) forgive my broken english :) – fennou Apr 04 '12 at 09:26
  • 2
    This use case is very similar to the one in the video presentation I linked above. Usually, historical data should not be loaded eagerly into the working memory, as it is rarely used as a whole. Historical data can be fetched on demand by using the "from" CE in your rules, so that you fetch only the data you need. The use of a cache or noSQL database for that will help improving response times. – Edson Tirelli Apr 04 '12 at 14:09
  • thank you so much for this very useful response, i will try to follow those steps, and if I get problems, I will come for you to help me to solve them.:) please forgive my broken english :) – fennou Apr 04 '12 at 14:36
  • What is a "copy operation" in "please note that this does not cause any copy operations as drools works with standard application POJOs as facts?" – mparaz Nov 07 '12 at 09:49
  • When you insert an object into a session all it is doing is making the object reference available to the engine, not copying or mapping any data from the original object into a different data structure. – Edson Tirelli Nov 10 '12 at 03:44