Home / Companies / Timescale / Blog / Post Details
Content Deep Dive

How to explore TimescaleDB using simulated IoT sensor data

Blog post from Timescale

Post Details
Company
Date Published
Author
Ajay Kulkarni
Word Count
1,209
Language
English
Hacker News Points
-
Summary

The Internet of Things (IoT) is a trend where computing is becoming ubiquitous and embedded in physical things to collect sensor data about the environment. TimescaleDB is a time-series database that can handle this type of data, which is generally time-series in nature with relational metadata. The tutorial explores the features and capabilities of TimescaleDB using an IoT sensor dataset meant to simulate a real-world IoT deployment. It starts by creating a new TimescaleDB instance via Timescale Cloud and setting up two tables: `sensors` and `sensor_data`. The `sensor_data` table is then populated with simulated data for four sensors, recording data every 5 minutes for the past 24 hours. Basic queries are run to calculate the average temperature and CPU by 30-minute window, and later to get the last temperature value in each period. Finally, a continuous aggregate view is set up to recompute the query automatically at regular time intervals and materialize the results into a table, speeding up the query significantly.