InfluxDB and Time-series Databases Tutorial
Learn InfluxDB and Time-series Databases step by step: 39 lessons in 9 chapters with examples, quizzes, diagrams and projects.
Start learning →
of lessons completed
Getting Started
- What Is InfluxDB? Learn what InfluxDB is, why time-series databases exist, what kinds of data they store, and what you will build and run in this course.
- InfluxDB Versions and Editions Understand the three InfluxDB generations, their query languages and terminology, the Core, Enterprise and Cloud editions, and how to choose one.
- Installing and Running InfluxDB Install and start InfluxDB 2.x and InfluxDB 3 Core with Docker or packages, set up the first user and token, and check that the server is healthy.
- The InfluxDB CLI and UI Tour Take a guided tour of the influx and influxdb3 command line tools and the 2.x web UI, then write and query your first data points step by step.
Concepts and Data Model
- Time-series Data Fundamentals Learn the core ideas behind time-series data: metrics versus events, regular and irregular sampling, gauges and counters, and how to choose a resolution.
- Measurements, Tags and Fields Learn the InfluxDB data model: measurements, tag keys and values, field keys and values, the timestamp, and how to decide what should be a tag.
- Series and Cardinality Learn what series cardinality is, how to calculate it from tag values, why high cardinality hurts, and practical schema rules that keep it under control.
- Timestamps, Precision and Time Zones Understand InfluxDB timestamps: nanosecond epoch values, write precision, RFC 3339 in queries, the duplicate-point rule and how to handle time zones.
- Buckets, Organizations and Tokens Learn how InfluxDB organizes and protects data with organizations, buckets or databases, retention periods and least-privilege API tokens, with CLI examples.
Writing Data
- Line Protocol: The InfluxDB Write Format Learn InfluxDB line protocol: the measurement, tag set, field set and timestamp syntax, how to write several points, comments, and common formatting mistakes.
- Line Protocol Types and Escaping Learn the five InfluxDB field types, how type conflicts are rejected, which characters to escape in line protocol, and how to write a safe serializer.
- Writing Data with the HTTP API Write line protocol to InfluxDB 1.x, 2.x and 3.x over HTTP with curl: endpoints, authentication headers, gzip, response codes and which errors to retry.
- Batching, Retries and Write Errors Write to InfluxDB efficiently with batching, flush intervals, retries with jitter, partial write handling, dead-letter queues and idempotent replays.
- Writing with Client Libraries Write and read InfluxDB data from Python, JavaScript and Go with the official client libraries, the Point builder, write options and error handling.
- Collecting Metrics with Telegraf Learn Telegraf, the plugin-driven agent for InfluxDB: inputs, processors, aggregators, outputs, a minimal configuration, testing it and running it as a service.
Querying: Flux and SQL
- Flux Basics: Pipelines, Tables and Functions Learn the Flux query language of InfluxDB 2.x: from, range, filter, the pipe-forward operator, the table stream model, variables, functions and the _time and _value columns.
- Flux: Filtering, Ranges and Aggregates Write efficient Flux queries: time ranges, predicate pushdown, filtering by tag and field, last and max per series, derivative for counters, map and sort.
- InfluxQL Basics: SQL-like Queries for InfluxDB Learn InfluxQL, the SQL-like InfluxDB language: SELECT, WHERE with time and tags, GROUP BY time with fill, SHOW schema queries, limits and compatibility.
- SQL Time-series Queries in InfluxDB 3 Query InfluxDB 3 with SQL: time filters, date_bin windows, gap filling, window functions, joins between measurements and selector functions, with runnable SQLite stand-ins.
- Windows, Gap Filling and Pivot Handle missing data in InfluxDB queries: createEmpty and fill in Flux, fill and linear interpolation in InfluxQL, gap filling in SQL, and pivoting fields into columns.
Retention and Downsampling
- Retention Periods and Data Expiry Learn how InfluxDB expires old time-series data with retention periods, why whole shard groups are dropped, and how to choose a retention period per bucket.
- Downsampling with Aggregate Windows Turn high-resolution time-series data into hourly or daily summaries with aggregate windows, keep min, max and count, and avoid the average-of-averages trap.
- Scheduled Downsampling with Tasks Automate downsampling with InfluxDB tasks, understand every and offset, and make rollups safe to re-run with idempotent writes. Includes runnable stand-ins.
Dashboards and Alerts
- Building Dashboards and Cells Build InfluxDB dashboards with cells, time-range and window variables, and queries that return the right number of points. Includes runnable stand-ins.
- Checks, Alerts and Notification Rules Learn how InfluxDB checks turn metrics into ok, info, warn and crit statuses, how deadman checks catch silence, and how notification rules avoid alert spam.
- Using Grafana with InfluxDB Connect Grafana to InfluxDB with Flux, InfluxQL or SQL, build template variables, and write safe time-series queries. Includes runnable query-building stand-ins.
Performance and Scaling
- Series Cardinality Explained Understand series cardinality in time-series databases, how tag choices multiply it, why high cardinality hurts, and how to find and fix it. Runnable examples.
- Schema Design for Performance Design time-series schemas that stay fast. Choose tags versus fields, wide versus narrow layouts, naming conventions and units. Runnable SQL comparisons.
- Batching and Write Performance Speed up InfluxDB writes with batching, sensible batch sizes, compression, timestamp ordering and retry with backoff. Runnable simulations of the trade-offs.
- Scaling and Architecture Choices Plan InfluxDB capacity from write rate and point size, understand scale-up and scale-out options, separate ingest and query, and know when to add a queue or edge tier.
Integrations
- Telegraf Pipelines: Inputs to Outputs Build Telegraf pipelines for InfluxDB with inputs, processors, aggregators and outputs. Read real TOML configs and run a JavaScript model of the pipeline.
- Client Library Patterns for InfluxDB Use InfluxDB client libraries well. Compare Python, JavaScript and Go clients, write and query patterns, error handling and testing, with a runnable mock client.
- MQTT and IoT Ingest into InfluxDB Bring IoT sensor data from MQTT into InfluxDB. Map topics to tags, parse payloads, handle device time and offline devices, with runnable stand-ins.
- Prometheus and Metrics Bridges Move Prometheus-style metrics into InfluxDB with Telegraf, understand counters, gauges and histograms, and compute per-second rates safely, including counter resets.
Projects and Practice
- Project: Server Monitoring Pipeline Design a complete server monitoring setup, from Telegraf collection and schema to rollups, top-N queries, percentiles and alert rules, with runnable SQL stand-ins.
- Project: IoT Climate Analysis Clean, fill, smooth and analyse IoT temperature data: find gaps, interpolate, detect outliers, compute moving averages and daily summaries with portable SQL.
- Project: OHLC Bars from Tick Data Turn a stream of trade ticks into open, high, low, close and volume bars per minute, add VWAP and returns, and learn the Flux and InfluxDB 3 equivalents.
- Time-series SQL Practice Set Practise the core time-series queries with graded exercises: windows, gaps, latest values, rates, moving averages and top-N per group. Runnable solutions included.
- Troubleshooting InfluxDB A practical checklist for common InfluxDB problems: missing points, write errors, slow queries, memory growth, disk usage and wrong results, with a runnable diagnostic tool.