-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to integrate a timeseries database into the data model? #227
Comments
@stephenholleran mentioned -
This could be a good option. I've been holding out on this a while now. A "platform" could ...
End-users would have to open all raw data files in Windographer & then import the data model On the flip side calibrating & flagging readings in a "platform" enables it to be more agnostic about tooling. In our case we're interested in tracking the data availability which requires this being applied |
Thanks @rdmolony . TimescaleDB sounds like would be one good option for storing timeseries. Though recommending a db is not part of core data model, we do have a postgres example like you noted. Would you be open to editing this example to include a timescaledb hypertable ? Perhaps, it can evolve into a blog on how the metadata could be joined with the timeseries. |
No problem @abohara, I could do that or also a separate The |
Thanks @rdmolony . That would be great. |
Hi all, I finally got around to writing up my experience on integrating Struggling to sync sensors & databases | rowanmolony.com My experience I wanted to gain some experience running it smoothly in production (the switch was made in September) to be sure it actually worked before posting anything. In the MRP context, How? It allowed us to use the web application database (i.e. the sensor metadata database) for storing & processing time series data rather than multiple tools. Two databases became one database1 &
How does this relate to the
How could it extend the data model? It enables storing readings in a database table just like the metadata. One could create one table per data source like ...
... or a single “long-format” table like …
I opted for the "long-format" table since it easily “mergeable” with metadata like …
… or flags of erroneous readings like …
… in select *
from sensor_reading_generic as reading
inner join sensor_metadata as meta
on meta.sensor_id = reading.sensor_id,
where station_id = <ID>
and timestamp between '2023-12-01' and now() Once the create table sensor_reading_generic (
timestamp timestamp not null,
mast_id integer not null,
file_id integer not null,
sensor_id integer not null,
generic_reading float,
primary key (timestamp, station_id, sensor_id)
);
select create_hypertable('sensor_reading_generic', 'timestamp');
alter table sensor_reading_generic set (
timescaledb.compress,
timescaledb.compress_orderby = 'timestamp DESC',
timescaledb.compress_segmentby = 'mast_id, file_id, sensor_id'
);
select add_compression_policy('sensor_reading_generic', interval '1 week');
I’m not that familiar with this data model. So I built it locally by …
From this model, I can see that one could use -
I don’t see -
To make the above joins easier in the context of the Let me know if you have any questions, or if interested want to discuss in more detail over a virtual coffee Footnotes
|
I mentioned
TimescaleDB
& discussed its pros/cons from an implementation perspective in #222 (comment) which was a little off-topic so I'm moving it here for further discussionThe text was updated successfully, but these errors were encountered: