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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Pushing Entries into Stream.


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.



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