On 9 May 2012 19:52, soumya_sd <soumya_sd(a)yahoo.com> wrote:
laune wrote
>
> Merely filtering a subset of data items from a collection according to
> user's changing needs and whims is NOT the primary use case of a
> production
> rule system. This kind of problem has been solved adequately and
> efficiently by SQL queries or some similar DB query technique.
>
> It is true that such filtering rules, if compiled and stored in a
> KnowledgeBase, can achieve the same thing, but, since rules are targeted
> at
> a more sophisticated use cases, this will never be as efficient as a
> simple
> query system.
>
> -W
>
>
you bring up an excellent point.
What if the data is streaming in nature and is not stored in a database and
outside of your control.
It you can insert it into a WM, it can't be "outside of your control". If
both data
and selection rules arrive at random, it's going to be chaotic. Some sort
of higher order control pattern will have to take care of that...
Another approach is to cache the data locally (in a database) and then use
SQL to filter it.
I decided not to use the database approach because of two reasons.
1. The database write operation may be expensive.
Storing a record in a DB is not really expensive.
2. In the future I may decide apply more complex consequence to my
rules
than just filtering.
The effort for processing of selected entities is the same, irrespective of
their source, be it
a DB or a WM. Compiling some processing statements could be done by
invoking the
Java compiler, without the additional overhead of compiling DRL first.
-W
Thanks.
--
View this message in context:
http://drools.46999.n3.nabble.com/Is-there-a-faster-way-of-doing-this-in-...
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users