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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

ThingWorx cache

AK_10385731
4-Participant

ThingWorx cache

What’s the best way to cache data in ThingWorx?

  • Should I use properties, configuration tables, or user sessions (of course user session is valid only for user)?
  • Are there other options available?

 

  1. If the value changes very frequently, is there a better alternative to Thing properties?
  2. If the value changes less frequently, what’s the best approach for caching?

Also, can Ignite be utilized for caching in any way?

 

I am aware that it depends on use case and scenario. I would like to know what are the feasible options available or supported by the ThingWorx platform.

 

Thank you in Advance.

 

-Abhiram

1 REPLY 1

The answer really depends on the amount of data and your access patterns. For large amount of data, I'd delegate caching to an external system like Redis and access it via a Java extension (no, I'm not aware of existing extensions for that, but implementing a new one is easy). One of the key questions you'd need to ask yourself is whether you cache for reducing latency or increasing the overall throughput. If it's the latter -- an external system is almost always a better choice.

 

For small and medium data volumes, non-persistent, non-logged "basic" (numbers, strings) properties are managed entirely in memory, and are thus fast enough for most caching scenarios. Infotables are slow. Reading/writing properties under Administrator will likely be (much?) faster, as ThingWorx won't perform permission checks. If you use shared caches, you'd need to be careful with threads synchronization, which ThingWorx doesn't do.

 

I'm not sure about the User session performance characteristics, as it is probably implemented via Tomcat session, which might have its own performance overhead, associated with serializability and thread safety. This is something you'd need to test.

 

Can't say anything about Ignite, sorry.

 

/ Constantine

Announcements


Top Tags