Hi,
I'll try to answer your questions.
On Tue, Jan 6, 2009 at 2:04 PM, isvana321 <pvincent@...> wrote:
> Hi Luis: congrats on tasking the CEP community with another apparent
> conundrum! I drafted a reply yesterday but thought it too obvious -
> today I see the debate continues so here are my thoughts...
>
> This is basically a query on an operational data (or event) store of
> stock prices. It's time based (ie a temporal query). You could use EP
> to monitor the events but (as I think has been discussed / you
> surmise) there is an initial query part too.
>
> 1. What was the stock price at time t-5? Was this above $70?
> 2. Were there any events that changed that in t to t-4.999999...? Was
> this above $70?
>
> I think Ophers blog on this topic is quite correct (albeit long!) -
> http://epthinking.blogspot.com/2009/01/on-event-processing-and-some.html .
>
> In providing a solution for this: probably I would want to know if
> (a) this was a generic problem:
> e.g. for any period p I want to know if stock S had a f(value)
> relative to some other value
Yes.
> (b) whether this was a continuous query or a static one (in the
> business sense)
> e.g. do I need to know the result for now to now-5 for all now's?
I purposely described the query as a static, ad-hoc one, to simplify.
But you may as well want to perform that query every time something
else happens (i.e., a client shows interest in buying Company X stock
actions). This could happen all the time or every so often. I don't
think (ideally) the solution should depend on how frequently the query
is issued.
> (b) whether the volumes require data grid storage or not
> e.g. whether I need to consider data access considerations.
No.
> (c) how often these queries would be required and their performance
> requirements
> e.g. is this a non-performance-critical occasional report, or a key
> application?
Let's suppose it is as performance critical as they get, but I want
the solution to scale well as load varies. I.e., I don't want the CPU
at 100% when nothing is happening.
>
> For example, it might make sense to relate all events (ie use a linked
> list) so I can (a) query / find the set s of all price events in time
> period p and (b) find the preceding event for the earliest member of s.
That seems similar to Aleri's solution. You''re managing the 5 minutes
window manually. It's a possibility, but if you need to do it
everywhere it becomes ugly pretty soon :-). I mean, do any of you
really believe that these types of queries are uncommon?
Thanks,
Luís Pureza
University of Coimbra