laune wrote
On 9 May 2012 19:52, soumya_sd <soumya_sd@> 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...
Correct. Pardon my language. What I really meant by "outside of my control"
is that source databases are not controlled by me. I query external
databases at runtime to get the results I need and then filter a subset
based on the user defined needs.
Currently I'm using Apache Camel for getting my data from remote sources.
laune wrote
>
> 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.
I didn't understand what you mean by "Compiling some processing statements
could be done by
invoking the Java compiler, without the additional overhead of compiling DRL
first.".
--
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.