cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Pushing Entries into Stream.

Bhanu_Manoj
9-Granite

Pushing Entries into Stream.

Hi Team,

 

I have tried to push multiple entries into a datatable using AddDatatableEntries and it is successful.

 

But when I tried to use the AddStreamEntries service to push data to stream, I am getting a null pointer exception.

 

1) Is it possible to push multiple entries into stream at a time.

2) What are the best cases when to use stream and when to use datatable.

 

1 REPLY 1

Hello @Bhanu_Manoj,

 

Have you tried using the service WritePropertiesToStream, this service can be used to add a row of data to a Stream.

 

Streams can store contextual data. For example, whenever a specific event is triggered, you can add the values of the other properties. This helps in the analysis of data
Use Streams to store and retrieve time series data.
Use Streams when you want to query data only within small time periods.
Ensure that your Data Tables have less than 100,000 rows.
Querying data from Data Tables and Streams should only take a few seconds.
If these Data Tables and Streams have more than 100,000 rows, the queries perform slowly


Use an external data store option if you need to perform any of the following tasks:
Query Streams for a large amount of data
Stream queries can retrieve a large number of records from the database before they are further filtered in the JVM memory.
It is recommended to add appropriate time intervals to minimize the number of rows retrieved by streams.
This helps especially when data starts to accumulate on the daily production use.

 

Data Table
Use for less than 100,000 rows of data. 
Use for static datasets and static lookup tables.
For highly dynamic and larger datasets, use a relational database that is connected via a Database ThingTemplate.

Data Tables do not support high-speed writing, as they do not have queuing mechanisms like Streams and Value Streams.
To manipulate or query the data row-by-row, use Data Tables.
Use indexes when working with Data Tables.

If you do not need to retrieve historical data very frequently, you can move all data to a separate ThingWorx instance (in a Data Table or Stream) or to a database server.

 

Top Tags