InfluxDB and Flux

Query and code together with Flux — a powerful language from the makers of InfluxDB that allows developers to gain insights across time.
InfluxDB and Flux
what is flux

What is Flux?

Flux lang is a functional data scripting language designed for querying, processing, writing, analyzing, and acting on data from InfluxDB and many other sources like SQL Databases (Big Query, PostgreSQL, MS SQL Server), annotated CSVs, JSON, and Bigtable.

The purpose of Flux

quotes

“Flux is much more flexible because it is not just a query language... The ability to combine data from different sources is great.”

Dr. Angelo Fausti, Software Engineer, Vera C. Rubin Observatory

Why use Flux?

Flux lang is easy to learn with excellent readability making it comfortable to be productive. It has a command line interface and a web-based UI for point-and-click script building. As Flux is a composable language, developers can chain together functions or build custom functions that work specifically for bespoke applications.

In addition, since Flux queries are code, they can be tested and checked into source control systems, be tested in isolation, or for complex queries, be built from separately tested sub-components. Finally, Flux allows developers to work in their preferred method.

Flux Features

Multiple data sources

Integrate disparate data sources, including databases, third-party APIs or filesystems anywhere data lives. Use the join function to combine data from your SQL databases with your time series data for greater insights.

Extensible

Flux has almost 400 functions available in the standard library that can help you retrieve, transform, process, and output data. Send notifications to external endpoints like ServiceNow, Slack, or PagerDuty or use the Geotemporal functions to tie together time series with location data.

Dynamic Types

Flux is a statically typed language that requires container types to contain data of a consistent type. Data formats like JSON don’t have type restrictions, and when used with “dynamic” types, Flux allows any JSON data to be represented accurately with Flux data types.

InfluxDB Tasks

Schedule Flux scripts to transform streams of data, write it back to InfluxDB, or trigger other actions. Some popular tasks include downsampling or sending alerts when thresholds are hit or Edge Data Replication.

Integrations

Flux plays nice with analytics tools and environments like Jupyter and uses the Apache Arrow data interchange format to speed integration with big data analytics systems.

Cross Compile

Work on top of Flux with other syntax like PromQL, InfluxQL, and others. Flux works on a single optimizer that plans against different sources.

Flux basics

Data from anywhere

InfluxDB supports querying, joining, and transforming time series, geo location and data from your SQL data sources to help you gain the insights you need in your applications.

Resources

VS Code Plugin

Write and run Flux scripts natively in VS Code

Flux syntax basics

This guide walks through how Flux handles a few simple expressions.

Work with Flux data types

A Flux data type defines the set of possible values and operations.

By Anais Dotis-Georgiou / Oct 06, 2022 / InfluxDBFlux

This article was originally published in The New Stack and is reposted here with permission. EDR enables developers to use the full capabilities of InfluxDB at the edge. Developers also can use that same data in the cloud for different purposes....

Influxdbu

Developer education

Access training for time series app developers.

community-new

Community

Our awards recognize the contributions of our developer community.

Scroll to Top