Skip to content

What InfluxDB Is

You have a sensor — a weather station, a server, a greenhouse controller — and it keeps producing readings. Each reading is small: a number or two, a label for where it came from, and the time it was taken. None of them will ever be edited. All of them together are the point: you will ask what the temperature did overnight, not what it is doing in row 4,096. A general-purpose database can store this, the way a filing cabinet can store a river — each drawer works, and the whole arrangement fights you.

InfluxDB is a database shaped like the data. It stores points: one measurement, at one moment, with labels. It expects writes to arrive constantly and reads to be questions about ranges of time — the last hour, yesterday, every ten-minute average since Monday. In exchange for that focus it gives you three things a general database makes you build yourself: a home for streams (buckets, with a built-in rule for how long data stays), a question language built around time (Flux), and a scheduler that keeps summaries up to date (tasks). Chapter 5 onward exercises each of them for real.

The credential warning belongs here, on page one, because InfluxDB's whole security model is one idea: a token is a string that is a permission. There is no password prompt at query time; whoever presents the token is trusted with everything the token allows. The first token, minted by the setup in chapter 3, allows everything — it is the keys to the building, not to one room. Treat tokens the way you treat passwords: one per job, scoped as narrowly as the job allows (chapter 7 mints one that can only read), stored in a password manager, never printed into scripts or chat. The lab behind this guide ran on a loopback port with throwaway tokens for exactly this reason — and even so, its transcripts redact them.

A first taste

After the setup in chapter 3, a reading is one line of text:

weather,station=rooftop-1 temperature=18.1,humidity=57i 1793499960

That is the line protocol: the measurement (weather), a label (station=rooftop-1), two values (temperature 18.1, humidity 57), and the moment, counted in seconds. And a question is a short pipe of operations:

from(bucket: "weather")
  |> range(start: -1h)
  |> filter(fn: (r) => r._field == "temperature")
  |> aggregateWindow(every: 20m, fn: mean, createEmpty: false)

Read it as: from the weather bucket, take the last hour, keep temperature, and give me the mean of each twenty minutes. The lab ran exactly this; the first window came back 18.25, which is (18.1 + 18.4) ÷ 2 — the guide checks its arithmetic where you can see it (transcript influxdb-lab/transcripts/t03-flux-queries.txt).

What it is not

InfluxDB is not a filing cabinet for records that change: there are no updates to negotiate, no joins across tables in the SQL sense, no transactions spanning points. A point is corrected by writing it again at the same moment (chapter 11 does exactly that), not by editing it. It is not a log store — lines of text with timestamps belong to tools like Loki (chapter 12). It is not a monitor by itself: it holds the numbers beautifully and draws nothing; dashboards come from its web interface or from Grafana. And — the naming trap this series insists on naming — the InfluxDB sold and documented today as the flagship is InfluxDB 3, a ground-up rewrite queried in SQL. This guide is about InfluxDB v2, the Flux generation: still the version most self-hosted installs in the wild are running, and the one whose binaries the lab verified.

Who it is for

The maker with sensors reporting to a cupboard server. The home-lab keeper who wants a year of temperatures, power draws and network latencies, kept without ceremony. The developer whose application emits metrics and who would rather not invent a storage format. The common thread is the same as the data: a stream of small truths, each stamped with its moment, and questions that are always, in the end, about time.