The time-series data is stored in a "cascade" of linked records (I'm
currently using LINKMAPs in documents, but the same could be done with
vertexes and edges); there are several possible structures, but one is
root->year->month->day->hour->minute->sample (this one allowing for
multiple samples per minute (and yes, the samples could be stored as an
EMBEDDEDMAP in the "minute" record, but that doesn't change the original
issue). So let's say I'm storing a sample for 2016-06-01 00:00:00 and this
is the first sample stored in that month and day. The "root" and "year"
exists, but none of the other records do, so I need to create
month->day->hour->minute->sample at once. The sample that comes in a few
seconds later would just add on to the "minute" record, while the sample
that comes in at 00:01:00 would need to create a new "minute" record and
link it from the corresponding "hour" record.

So the solution I've arrived at since asking the original question is to
build a SQL batch dynamically based on the last known sample time for a
given time-series (knowing that lets me know what "chain" of records
already exists and what needs to be created, ranging from a single new
record (with one "upstream" link update) to as many as six new records in a
linked chain. This works and seems fairly efficient, but maybe there's a
better way?

By the way, I would have preferred to use a Javascript function instead of
a client-generated SQL batch, but I got too frustrated trying to "discover"
the Javascript function environment and syntax by trial and error. As far
as I can tell, there is no documentation beyond a few examples here and
there on the objects and functions available in the Javascript function
environment. Are you aware of any?


On Sun, Jun 5, 2016 at 8:48 AM, 'scott molinari' via OrientDB <
orient-database@googlegroups.com> wrote:

> You say your problem is inserting a number of documents at the same time.
> At what point in storing the time series data is that necessary?
>
> Scott
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "OrientDB" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/orient-database/21wTp42oZEI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> orient-database+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to