In this post, I will use an instance of InfluxDB and Chronograf.
See this post for installing both using Docker.
InfluxDB - Time Series Databases
InfluxDB is a time series database. It allows users to work with and organize time series data. The advantage of such a database system is that it comes with built-in functionality to easily aggregate and operate on data based on time intervals. Other types of databases can do this as well - but time series databases are heavily optimized for this kind of data structures which will show in storage space and performance.
Data is stored in the database with its timestamp, its value and one or more tags.
Values can be aggregated by intervalls, i.e. "give me the temperatur values within the last hour and take the average for 5 minutes". This would result in (60 / 5) = 12 results with a value that represents the average temperature within this 5 minute interval.
Example: Temperature Data averaged by 4 minutes
|2019-01-24T00:00:00||(23 + 22 + 21+ 23) / 4 = 22,25|
|2019-01-24T00:04:00||(24 + 25 + 23) / 3 = 24|
InfluxDB in ThingWorx
The new ThingWorx 8.4 release comes with an option to setup InfluxDB as additional Persistence Provider. Meta Data like Entity Definitons will still be stored in PostgreSQL. Streams, Value Streams and Data Tables however can be stored in InfluxDB.
The InfluxDB Persistence Provider setup is delivered with the PostgreSQL installation package for ThingWorx. Currently ThingWorx does not allow any aggregation of data with its built-in InfluxDB capabilities.
InfluxDB will need a user and a database.
Connect via Chronograf - the graphical UI to administer InfluxDB and create a new user via
Create a new database via
Create a new Persistence Provider for InfluxDB in ThingWorx - but don't mark it as active yet!
Switch to the Configuration and change the username / password, database and hostname to match your installation.
Save the configuration, switch back to the General tab and mark the InfluxDB Persistence Provider as Active.
Save again and a "successful" message will be shown. If the save action failed, the connection settings are not correct - check for the correct ports and for any typos.
Creating Entities & Testing
Streams, Value Streams and Data Tables can now be created using the new InfluxDB Persistence Provider.
To test with a Value Stream
ThingWorx 8.4 will be released end of January 2019.
Be sure to check out and test the new Persistence Provider features!
InfluxDB should be supported for Windows as well.
The installers for various operating systems are available at https://portal.influxdata.com/downloads/
I installed InfluxDB 1.8 version on Docker Container and i can also mount a volume on my Operating System ( Windows 10 ) . I created new PersistenceProvider and i can successfully use InfluxDB my PersistenceProvider for ValueStreams.
I also installed Grafana and Chronograph ( both are also in docker containers ) and i visualized pushed data from Kepware.
However i encountered an problem. Once that by influxDB instance is stopped and re started, the connection between InfluxDB and ThingWorx is not reinitializing automaticly. I have to go my InfluxDB PersistenceProvider Thing and click 'SAVE' button. After i did press save button, InfluxDB is starting to log ValueStream data.
Is there any way to see that InfluxDB as a PersistenceProvider is connected and ready to rock? And if is not, can be 'SAVED' through and api in ThingWorx?
I am also using Community Version of InfluxDB.
There are two services in the Persistence Provider : TestConnectivity and IsConnected - they will show if the status is OK or not (true or false).
Maybe you could use the ConnectDataSource service to re-establish the connection.
However, I just tested to disconnect / re-connect and the InfluxDB connection was established automatically again. On the test system I'm using ThingWorx 8.4.4. - maybe it's related to the version or configuration.
Thanks for your reply.
I found those services and i tried and control my connectivity status.
I also tested that when InfluxDB is started, ThingWorx connected automaticly. But i think is better the check connectivity in regular basis.
Thanks a lot !