Time series data (Karyn - Live)
Why CrateDB for Time Series?
Data Model Template
CREATE TABLE IF NOT EXISTS devices_readings (
ts TIMESTAMP WITH TIME ZONE,
device_id TEXT,
battery OBJECT(DYNAMIC) AS (
level BIGINT,
status TEXT,
temperature DOUBLE PRECISION
),
cpu OBJECT(DYNAMIC) AS (
avg_1min DOUBLE PRECISION,
avg_5min DOUBLE PRECISION,
avg_15min DOUBLE PRECISION
),
memory OBJECT(DYNAMIC) AS (
free BIGINT,
used BIGINT
),
month timestamp with time zone GENERATED ALWAYS AS date_trunc('month', ts)
) PARTITIONED BY (month);Ingesting and Querying
Data Ingestion
Aggregation and Transformations
Typical time-series functions
Downsampling & Interpolation
Schema Evolution & Contextual Data
Storage Optimization
Advanced Use Cases
Further Learning & Resources
Last updated

