TimescaleDB is an open-source database designed to make SQL scalable for time series data. TimescaleDB is packaged as a PostgreSQL extension and released under the Apache 2 open-source license.
A time series indexes a series of data points in chronological order, usually as a sequence over regular intervals. Examples of a time series include:
The temperature of a home during a day
The position of a satellite during a day
The data in these examples constitutes a monitored value (temperature or position) corresponding to the time at which the reading of the value took place.
To use TimescaleDB with Aiven for PostgreSQL:
Connect to your Aiven for PostgreSQL primary instance with PostgreSQL version 10.3 or later. You can use any PostgreSQL client for this (psql, DBeaver, PSequel, for example). For more information on connecting to your Aiven for PostgreSQL instance, see this article.
Create the TimescaleDB extension:
CREATE EXTENSION timescaledb CASCADE;
Create a time series table to store your time series data:
CREATE TABLE location_condition (
time TIMESTAMPTZ NOT NULL,
location TEXT NOT NULL,
temperature DOUBLE PRECISION NULL,
humidity DOUBLE PRECISION NULL
Add the times series data into the table that you created:
INSERT INTO location_condition(time, location, temperature, humidity) VALUES (NOW(), 'office', 70.0, 50.0);
Learn how Aiven simplifies PostgreSQL: