August 31st 2021
Dr. Thomas Heid
IS IT A TABLE?
NO, IT‘S MUCH MORE!
Finally understand tags, fields and measurements
AGENDA
August 8th 2021
Is it a table? No it's much more!
2
• WHAT IS INFLUXDB?
• EXAMPLES OF USAGE
• KEY CONCEPTS
• DEEPER INTO FIELDS, TAGS
AND MEASUREMENTS
• HOW TO ACCESS
• LET‘S BUILD IT WITH FLUX AND PYTHON
ABOUT MYSELF:
• PHD IN ASTROPARTICLE PHYSICS
• SINCE 2017 WORKING FOR ASTRUM IT
• SENIOR CONSULTANT
FOCUS ON:
• FOCUS ON BUSINESS INTELLIGENCE
• PROCESS OPTIMIZATION
August 8th 2021
Is it a table? No it's much more!
3
Images: km3net.org; https://de.wikipedia.org/wiki/Python_(Programmiersprache);
https://de.wikipedia.org/wiki/R_%28Programmiersprache%29
Just like your old strength, but way stronger: Together, we are going
to discover the new digital potential of your company, accelerate your
business processes, enhance your service offer – or open up entirely
new business lines. ASTRUM IT for your company stands for the future
of your business.
ASTRUM IT
28
Years of Consulting
IT-PERFORMANCE MADE IN GERMANY
The company is now run by the second generation and is,
among other things, the winner of the Bavarian Innovation
Award.
Service areas include IT consulting as well as development of
individual software solutions and innovative software
products.
150
Experts
3
Expert Sites: Erlangen,
Munich, Augsburg
246
Projects Since 2007
EXAMPLES @ ASTRUM: ERIK
August 8th 2021
Is it a table? No it's much more!
6
ERIK
Image credits to ERIK partners
EXAMPLES @ ASTRUM: SPX MONITORING
August 8th 2021
Is it a table? No it's much more!
7
EXAMPLES @ ASTRUM: SPX MONITORING
August 8th 2021
Is it a table? No it's much more!
8
WHAT IS INLUXDB?
Used for:
▪Time stamped data
▪Huge data volumes → indexing
▪Continuous querying
August 8th 2021
Is it a table? No it's much more!
9
WHAT IS INLUXDB?
August 8th 2021
Is it a table? No it's much more!
10
▪Defining points by time and series
▪Changes to data are very rare
▪Aggregating is the most common
operation
WHAT IS INLUXDB?
▪Retention
▪Old data becomes less important
August 8th 2021
Is it a table? No it's much more!
11
INFLUXDB IS NOTHING WITHOUT ITS COMPANIONS
▪Collecting
▪Preprocessing
▪Processing
▪Display
August 8th 2021
Is it a table? No it's much more!
12
August 8th 2021
Is it a table? No it's much more!
13
Python
CSV Plugin
Image taken from: influxdata.com
KEY CONCEPTS: STARTING FROM THE KNOWN
▪ Bucket → Database
▪ Measurement → Table
▪ Series → Query Result
▪ Tag → Column
▪ Field → Column
▪ Time → Column
August 8th 2021
Is it a table? No it's much more!
14
OK
Collection of series
Built-in concept to reduce work load
Indexed values
Continuous, not indexed values
The fabric of the data,
Explanations I have heard of Explanations I think of in the context of InfluxDB
KEY CONCEPTS: MEASUREMENT
August 8th 2021
Is it a table? No it's much more!
15
ERIK
SPx-Monitoring
Single Server
Each single kind of Play within the Therapy
KEY CONCEPTS: FIELDS
▪ Combination of keys and values
▪ Combination of fields are a field set
▪ Store values with a wide range of possible values
August 8th 2021
Is it a table? No it's much more!
16
KEY CONCEPTS: FIELDS
August 8th 2021
Is it a table? No it's much more!
17
ERIK
SPx-Monitoring
• CPU usage
• GPU usage
• Temperature
• Arousal
• How excited is the child
• Value in a well defined range
• Recorded during therapy
• Mimikry
• How well can you recognize emotions
• Aggregated value over parts of therapy
KEY CONCEPTS: TAGS
▪ Combination of keys and values
▪ Combination of tags are a tag set
▪ Indexed
▪ Can be searched and grouped without looking at each datapoint
▪ Basis of time series
August 8th 2021
Is it a table? No it's much more!
18
KEY CONCEPTS: TAGS
August 8th 2021
Is it a table? No it's much more!
19
ERIK
SPx-Monitoring
• Type of CPU
• …
• Participant
• Low number is expected
• Phase
• Relaxation, playing, stress
• Very limited range
• Questioning for
• Emotion
• Which emotion was trained right now
USING MEASUREMENT OR TAG
▪ You have questions!
▪ Ask these questions!
August 8th 2021
Is it a table? No it's much more!
20
▪ Looking at one server at once → make it as
measurement
▪ Comparing many children in serveral behaviours
→ keep the behaviour as measurement
Make your queries shorter and more readable
THE SERIES
▪ Tag combinations lead to series
▪ A tag set defines a series
▪ Bulky measurements are divided into
multiple smaller tables
August 8th 2021
Is it a table? No it's much more!
21
ANSWERING YOUR QUESTIONS
▪ Is time important?
▪ What do I want to show?
▪ What filters do I need?
▪ What groupings?
▪ Do values in fields really have to be side by side?
▪ What values do I want to compare?
August 8th 2021
Is it a table? No it's much more!
22
INDEXED TAGS → CARDINALITY
The number of unique measurement, tag set, and field key combinations in an InfluxDB bucket.
High cardinality →
▪ Huge memory usage
▪ Long processing times
Dangerous situations
▪ High number of possible tag values
▪ Example: large number of customers (stored as tags)
▪ No real definition of „big“: keep an eye on it
August 8th 2021
Is it a table? No it's much more!
23
LET‘S GET OUR HANDS DIRTY
August 8th 2021
Is it a table? No it's much more!
24
DOWNSIDES: UPDATE A POINT
August 8th 2021
Is it a table? No it's much more!
25
KEY FACT: A POINT IS IDENTIFIED BY A MEASUREMENT, TAG SET AND THE TIMESTAMP
• CANNOT CHANGE TAG VALUES
• CANNOT ADD A TAG
• CANNOT REMOVE A TAG
Work arounds
▪ Add additional tags
▪ Marginally increase time stamp
Use Cases
▪ Versioning
▪ Forecasts
▪ Updated algorithms
▪ Multiple algorithms
ADVICES: WHY TO USE TAGS AND MEASUREMENTS
Build your schema starting from the query
▪ Make the query easy!
▪ Make the query readable!
▪ Make the query small!
▪ Make the query fast!
August 8th 2021
Is it a table? No it's much more!
26
CONCLUSIONS
▪ Tags are filled with a restricted number of differing values
▪ Fields are filled with wide ranged values
▪ Best start from your queries (if it is possible)
▪ Focus to your questions, first.
It is not one table. The InfluxDB measurement is many tables.
Contact: thomas.heid@astrum-it.de,
August 8th 2021
Is it a table? No it's much more!
27

Understanding InfluxDB Basics: Tags, Fields and Measurements

  • 1.
    August 31st 2021 Dr.Thomas Heid IS IT A TABLE? NO, IT‘S MUCH MORE! Finally understand tags, fields and measurements
  • 2.
    AGENDA August 8th 2021 Isit a table? No it's much more! 2 • WHAT IS INFLUXDB? • EXAMPLES OF USAGE • KEY CONCEPTS • DEEPER INTO FIELDS, TAGS AND MEASUREMENTS • HOW TO ACCESS • LET‘S BUILD IT WITH FLUX AND PYTHON
  • 3.
    ABOUT MYSELF: • PHDIN ASTROPARTICLE PHYSICS • SINCE 2017 WORKING FOR ASTRUM IT • SENIOR CONSULTANT FOCUS ON: • FOCUS ON BUSINESS INTELLIGENCE • PROCESS OPTIMIZATION August 8th 2021 Is it a table? No it's much more! 3 Images: km3net.org; https://de.wikipedia.org/wiki/Python_(Programmiersprache); https://de.wikipedia.org/wiki/R_%28Programmiersprache%29
  • 4.
    Just like yourold strength, but way stronger: Together, we are going to discover the new digital potential of your company, accelerate your business processes, enhance your service offer – or open up entirely new business lines. ASTRUM IT for your company stands for the future of your business. ASTRUM IT
  • 5.
    28 Years of Consulting IT-PERFORMANCEMADE IN GERMANY The company is now run by the second generation and is, among other things, the winner of the Bavarian Innovation Award. Service areas include IT consulting as well as development of individual software solutions and innovative software products. 150 Experts 3 Expert Sites: Erlangen, Munich, Augsburg 246 Projects Since 2007
  • 6.
    EXAMPLES @ ASTRUM:ERIK August 8th 2021 Is it a table? No it's much more! 6 ERIK Image credits to ERIK partners
  • 7.
    EXAMPLES @ ASTRUM:SPX MONITORING August 8th 2021 Is it a table? No it's much more! 7
  • 8.
    EXAMPLES @ ASTRUM:SPX MONITORING August 8th 2021 Is it a table? No it's much more! 8
  • 9.
    WHAT IS INLUXDB? Usedfor: ▪Time stamped data ▪Huge data volumes → indexing ▪Continuous querying August 8th 2021 Is it a table? No it's much more! 9
  • 10.
    WHAT IS INLUXDB? August8th 2021 Is it a table? No it's much more! 10 ▪Defining points by time and series ▪Changes to data are very rare ▪Aggregating is the most common operation
  • 11.
    WHAT IS INLUXDB? ▪Retention ▪Olddata becomes less important August 8th 2021 Is it a table? No it's much more! 11
  • 12.
    INFLUXDB IS NOTHINGWITHOUT ITS COMPANIONS ▪Collecting ▪Preprocessing ▪Processing ▪Display August 8th 2021 Is it a table? No it's much more! 12
  • 13.
    August 8th 2021 Isit a table? No it's much more! 13 Python CSV Plugin Image taken from: influxdata.com
  • 14.
    KEY CONCEPTS: STARTINGFROM THE KNOWN ▪ Bucket → Database ▪ Measurement → Table ▪ Series → Query Result ▪ Tag → Column ▪ Field → Column ▪ Time → Column August 8th 2021 Is it a table? No it's much more! 14 OK Collection of series Built-in concept to reduce work load Indexed values Continuous, not indexed values The fabric of the data, Explanations I have heard of Explanations I think of in the context of InfluxDB
  • 15.
    KEY CONCEPTS: MEASUREMENT August8th 2021 Is it a table? No it's much more! 15 ERIK SPx-Monitoring Single Server Each single kind of Play within the Therapy
  • 16.
    KEY CONCEPTS: FIELDS ▪Combination of keys and values ▪ Combination of fields are a field set ▪ Store values with a wide range of possible values August 8th 2021 Is it a table? No it's much more! 16
  • 17.
    KEY CONCEPTS: FIELDS August8th 2021 Is it a table? No it's much more! 17 ERIK SPx-Monitoring • CPU usage • GPU usage • Temperature • Arousal • How excited is the child • Value in a well defined range • Recorded during therapy • Mimikry • How well can you recognize emotions • Aggregated value over parts of therapy
  • 18.
    KEY CONCEPTS: TAGS ▪Combination of keys and values ▪ Combination of tags are a tag set ▪ Indexed ▪ Can be searched and grouped without looking at each datapoint ▪ Basis of time series August 8th 2021 Is it a table? No it's much more! 18
  • 19.
    KEY CONCEPTS: TAGS August8th 2021 Is it a table? No it's much more! 19 ERIK SPx-Monitoring • Type of CPU • … • Participant • Low number is expected • Phase • Relaxation, playing, stress • Very limited range • Questioning for • Emotion • Which emotion was trained right now
  • 20.
    USING MEASUREMENT ORTAG ▪ You have questions! ▪ Ask these questions! August 8th 2021 Is it a table? No it's much more! 20 ▪ Looking at one server at once → make it as measurement ▪ Comparing many children in serveral behaviours → keep the behaviour as measurement Make your queries shorter and more readable
  • 21.
    THE SERIES ▪ Tagcombinations lead to series ▪ A tag set defines a series ▪ Bulky measurements are divided into multiple smaller tables August 8th 2021 Is it a table? No it's much more! 21
  • 22.
    ANSWERING YOUR QUESTIONS ▪Is time important? ▪ What do I want to show? ▪ What filters do I need? ▪ What groupings? ▪ Do values in fields really have to be side by side? ▪ What values do I want to compare? August 8th 2021 Is it a table? No it's much more! 22
  • 23.
    INDEXED TAGS →CARDINALITY The number of unique measurement, tag set, and field key combinations in an InfluxDB bucket. High cardinality → ▪ Huge memory usage ▪ Long processing times Dangerous situations ▪ High number of possible tag values ▪ Example: large number of customers (stored as tags) ▪ No real definition of „big“: keep an eye on it August 8th 2021 Is it a table? No it's much more! 23
  • 24.
    LET‘S GET OURHANDS DIRTY August 8th 2021 Is it a table? No it's much more! 24
  • 25.
    DOWNSIDES: UPDATE APOINT August 8th 2021 Is it a table? No it's much more! 25 KEY FACT: A POINT IS IDENTIFIED BY A MEASUREMENT, TAG SET AND THE TIMESTAMP • CANNOT CHANGE TAG VALUES • CANNOT ADD A TAG • CANNOT REMOVE A TAG Work arounds ▪ Add additional tags ▪ Marginally increase time stamp Use Cases ▪ Versioning ▪ Forecasts ▪ Updated algorithms ▪ Multiple algorithms
  • 26.
    ADVICES: WHY TOUSE TAGS AND MEASUREMENTS Build your schema starting from the query ▪ Make the query easy! ▪ Make the query readable! ▪ Make the query small! ▪ Make the query fast! August 8th 2021 Is it a table? No it's much more! 26
  • 27.
    CONCLUSIONS ▪ Tags arefilled with a restricted number of differing values ▪ Fields are filled with wide ranged values ▪ Best start from your queries (if it is possible) ▪ Focus to your questions, first. It is not one table. The InfluxDB measurement is many tables. Contact: thomas.heid@astrum-it.de, August 8th 2021 Is it a table? No it's much more! 27