Explore the Value Stream, Stream, Data Table, and Info Table storage methods.
This guide will introduce Values Streams, Streams, Data Tables, and Info Tables.
Value Streams and Streams are methods of storage for time-series data, while Data Tables and Info Tables are methods of storage for non-time-series data.
You will learn how to create and utilize these mass data storage methods.
NOTE: The estimated time to complete this guide is 60 minutes.
If your data is largely composed of current values of remote IoT devices (and historical values are unimportant), then the simplest solution is most likely to store them as Properties of Things.
However, as opposed to instantaneous current values, there is also “mass data”. Mass data can include large datasets composed of historical records or spreadsheet-like grids.
Properties (at least by themselves) aren’t really appropriate in that case, as they typically only store the most recent value.
When it comes to mass data, different storage methods are good for different types.
At an extremely high level, ThingWorx divides mass data into roughly two categories:
In addition, ThingWorx also subdivides these two categories into either 1) tied to a Thing or 2) independent of any one Thing. Mass data storage that is tied to a Thing will logically only accept information from that one Thing, while independent storage may be used to aggregate information from many Things into a single location.
Storage Solution Time-Series Tied to a single Thing
Value Streams | YES | YES |
Streams | YES | NO |
Data Tables | NO | NO |
Info Tables | NO | YES |
The following pages will address these storage types in-depth.
In this step, we'll create a Value Stream to be used as a storage location.
Value Streams by themselves do nothing. Instead, they must be tied to a Thing.
Since Value Streams must be tied to a Thing, we'll create one now and then attach the previously-created Value Stream.
Now that we have a Thing with an attached Value Stream, we'll create a Property of that Thing and set it to be Logged.
If a Value Stream is attached to a Thing, value-changes of all Logged Properties will get automatically recorded along with a timestamp.
Check the Logged checkbox.
This causes all value changes to be logged to the attached Value Stream.
In a real-world application, Property value changes would likely occur through a connection to a remote IoT device.
For simplicity, we'll instead manually change the values.
Because the Property is Logged and there is a connected Value Stream, each change will be recorded and timestamped.
One of the most common ways to retrieve time-series information is with the built-in QueryPropertyHistory Service.
QueryPropertyHistory may be used to retrieve logged value-changes for usage in a different, custom Service which could manipulate the data, as well as in Mashups for Widgets like a Grid or Line Chart.
In the bottom-right of the Execute Service: QueryPropertyHistory pop-up, click Execute.
A Value Stream is a simple and easy way to record all time-series changes of a particular Thing Property's values.
The QueryPropertyHistory built-in Service may be used both in a custom Service to extract the value changes and Timestamps from a Value Stream, as well as in a Mashup to display how values change over time (in a Line Chart, for instance).
Click here to view Part 2 of this guide.