Sensors that collect sci­en­tif­ic or in­dus­tri­al mea­sure­ment data generate large volumes of data in a short period time. This data has to be processed together with a timestamp of the mea­sure­ment. Special databases are required for this time series data. This article focuses on InfluxDB, a database man­age­ment system (DBMS) specially designed for this task.

What is InfluxDB?

InfluxDB is a database man­age­ment system developed by In­flux­Da­ta, Inc. InfluxDB is open-source and can be used free of charge. The InfluxDB En­ter­prise version offers main­te­nance agree­ments and special access controls for business customers, and is installed on a server within a corporate network. In addition, the new InfluxDB 2.0 version runs as a cus­tomiz­able cloud service with a web-based user interface for data ingestion and vi­su­al­iza­tion.

The InfluxDB database man­age­ment system is written in Google’s pro­gram­ming language Go, also known as Golang. The first version of InfluxDB used InfluxQL, a query language developed by In­flux­Da­ta, for external database queries.

InfluxDB 2.0 is written in a new language called Flux, which In­flux­Da­ta publishes on GitHub as an open-source project. The project is updated on GitHub by de­vel­op­ers working with time series data. Flux is a stand­alone language for time series databases (TSDB). It can be used with InfluxDB version 1.7 and higher, either in­de­pen­dent­ly or with third-party databases.

Flux is optimized for ETL processes (extract, transform, load) in databases and is not com­pat­i­ble with the InfluxQL query language pre­vi­ous­ly used. However, In­flux­Da­ta is planning a migration path for existing customers to translate InfluxQL code into Flux.

Flux syntax is based on the popular language JavaScript. It is easy to learn and can be expanded. A key feature of Flux is that it can integrate different data sources using third-party APIs, for example. As a result, Flux is com­pat­i­ble with analytics tools like Jupyter. The Apache Arrow data in­ter­change interface permits com­mu­ni­ca­tion with other systems and in­te­gra­tion in big data en­vi­ron­ments.

When is InfluxDB used?

InfluxDB is ideal for time-series databases (TSDB), which store time series. These databases are used, among other things, to store and analyze sensor data or protocols with time­stamps over a certain period of time. For example, Internet of Things devices or sci­en­tif­ic measuring in­stru­ments deliver millions of incoming data sets in a constant stream of data.

This data must be quickly processed once it reaches the database. For this reason, InfluxDB includes a built-in time service that uses the Network Time Protocol (NTP) to ensure that time is syn­chro­nized between all systems.

With InfluxDB, a database can be very compact and must contain only two or three columns. In this example, the data source, the actual value and the cor­re­spond­ing time stamp are stored in the database.

Sensor Value Time
Sensor 1 140.50 04/23/2020 @ 10:00
Sensor 2 110.02 04/23/2020 @ 10:00
Sensor 1 142.32 04/23/2020 @ 10:05 AM
Sensor 2 110.50 04/23/2020 @ 10:05 AM

InfluxDB dif­fer­en­ti­ates between tag and field columns. Where a tag is simply metadata that is included in the index, fields contain values that can be analyzed. In our example, the first column is a tag and the second one is a field. This dif­fer­en­ti­a­tion makes it easier to manage the database and analyze mea­sure­ment data.

What are the ad­van­tages of InfluxDB?

Compared to ordinary re­la­tion­al databases, TSDBs like InfluxDB offer clear speed ad­van­tages when it comes to storing and pro­cess­ing time-stamped mea­sure­ment data. A tra­di­tion­al DBMS slows down when or­ga­niz­ing complex indexes, which are not used at all in this area of ap­pli­ca­tion. InfluxDB can maintain high write speeds over a long period of time because it uses a very simple index.

Unlike version 1.x, the new InfluxDB Cloud 2.0 from In­flux­Da­ta is a cloud-based solution that can run on Amazon Web Services (AWS), the Google Cloud Platform (GCP) or Microsoft Azure. With server­less computing, you don’t need your own server in­fra­struc­ture. In the cloud version, you no longer have to reserve in­di­vid­ual servers. Instead, the system au­to­mat­i­cal­ly adjusts to the load, which is important for in­dus­tri­al IoT ap­pli­ca­tions and machine learning, where the volume of data can change in­stan­ta­neous­ly.

Whereas the first version required the TICK stack (Telegraf, InfluxDB, Chrono­graf and Kapacitor), InfluxDB 2.0 already has every­thing you need. Both the local and cloud versions contain the entire database man­age­ment system in a single program file currently available for 64-bit Linux, Linux for ARM proces­sors, macOS, and as a docker container. Telegraf etc. can still be used to collect data for InfluxDB 2.0.

First steps in InfluxDB

InfluxDB offers free access to InfluxDB Cloud 2.0 for anyone getting started with the solution. This plan allows you to try out the database and the entire hosted, multi-user data platform for time series data. InfluxDB Cloud 2.0 also contains modules for col­lect­ing, eval­u­at­ing and vi­su­al­iz­ing stored data.

The free version offers limited data rates for reads and writes, up to 10,000 data sets, and a maximum storage period of 30 days. These limits are usually suf­fi­cient for hobby projects, in which case the free version would suffice. A free plan can later be upgraded to a paid, usage-based plan without losing data.

To get started, create a free user account on the InfluxDB Cloud 2.0 signup page. Then click the ver­i­fi­ca­tion link in the email.

After verifying your user account, log in and select your cloud provider. In Europe, InfluxDB Cloud 2.0 is currently available only via Amazon Web Services (AWS). However, this is not an issue if you’re using the free version. If you’re already using Amazon Web Services or Google Cloud Platform (GCP), you can subscribe to the InfluxDB cloud products through the mar­ket­places of these cloud providers.

Once you’ve logged in, InfluxDB displays your personal dashboard, where your data is collected and vi­su­al­ized. Data can be collected via Telegraf plug-ins, the InfluxDB v2 API, the Influx command line interface (CLI) or directly via the InfluxDB user interface. Client libraries for various popular pro­gram­ming languages are also available.

You can create Telegraf con­fig­u­ra­tions in­ter­ac­tive­ly or copy existing con­fig­u­ra­tions to send data to the InfluxDB Cloud 2.0 instance. Once you’ve con­fig­ured InfluxDB cloud to collect data, you can create personal dash­boards to query and display the data.

In the InfluxDB data explorer, you can explore and visualize the collected data. You can adjust time intervals and ranges for re­fresh­ing the dashboard’s data according to the needs of your project. The InfluxDB user interface provides a variety of at­trac­tive vi­su­al­iza­tion options. The web in­ter­faces allows you to move seam­less­ly between the Flux Builder and manual editing of database queries.

On the “Usage” page, you can view your current database usage at any time to determine whether a paid plan might be worth­while.

The most important new features of InfluxDB Cloud 2.0 at a glance

Free plan (with limits): No down­load­ing, no in­stal­la­tion and no in-house server in­fra­struc­ture required; fastest in­tro­duc­tion to InfluxDB 2.0 tech­nol­o­gy; the free plan is designed for getting started with InfluxDB and for small hobby projects.

Flux support: Flux is a stand­alone scripting and query language for time series databases that increases pro­duc­tiv­i­ty by allowing easy reuse of code. Flux was developed and optimized for working with data in InfluxDB 2.0, but it can also be used with other data sources.

Unified API: The unified InfluxDB v2 API offers access to all InfluxDB com­po­nents, such as data ingestion, query, storage and vi­su­al­iza­tion. This enables seamless movement between the installed open source version and the InfluxDB Cloud 2.0 version.

Vi­su­al­iza­tion and dash­boards: Based on the in­no­v­a­tive Chrono­graf project from the first version of InfluxDB, the new user interface offers sig­nif­i­cant­ly faster results when vi­su­al­iz­ing and querying data in real-time.

Usage based pricing plans: Usage-based billing offers more flex­i­bil­i­ty than a self-hosted database system and ensures that you only pay for what you actually use.

Go to Main Menu