Video by freeCodeCamp.org · streamed from YouTube. All rights remain with the creator.
Lesson 3: Time-Series Data with TimescaleDB
About this lesson
Sensor readings, application logs and records of what an AI agent did all share one feature: every row is stamped with a time, and new rows never stop arriving. This lesson teaches how to store and query that kind of data with TimescaleDB, an extension that turns PostgreSQL into a time-series database while keeping ordinary SQL. The course has five parts and builds two projects. It opens with hypertables, tables that are divided automatically into chunks by time. The second part covers columnar storage and compression, which shrink older data dramatically and speed up analytical queries. Part three introduces continuous aggregates, summaries that the database keeps up to date in the background so that dashboards do not have to re-read raw data. Part four explores hyperfunctions, a library of functions made for time-series analysis, including ways to fill the gaps left when a device goes quiet. The last part deals with data tiering, where old data moves to cheaper object storage but remains available to queries, and with using vector search alongside time-series tables. The first project is a flight recorder that logs the actions of an AI agent and runs locally in Docker. The second is a telemetry system for a fleet of 2,000 electric vehicle chargers, deployed to a cloud service. You should already know basic SQL; no earlier experience with time-series databases is assumed. Afterwards, read Chapter 3 of the course book, which works out the row counts and storage for such a fleet and illustrates chunks and gap filling.