Hi everyone,
I am currently working on a use case where we have multiple repositories, and each path contains around 25 images, each with a file size of approximately 400 KB.
The customer would like to retrieve (“auslesen”) these images via an API from ThingWorx.
Before I implement the solution, I would like to get some best-practice recommendations from the community:
What is the best way to prepare and serve many images via API in ThingWorx?
Should we use:
LoadBinary for each image,
LoadImage,
SaveImage / Base64 output,
or another recommended approach?
Is it more efficient and possible to:
Return image streams directly,
Convert them to Base64,
Or provide download URLs (e.g., via Content Caching)?
Are there performance concerns when retrieving 25×400 KB = ~10 MB per request from a ThingWorx server?
Any recommended throttling, batching, or pagination strategies?
We want to provide the customer with a clean, fast, and scalable API that allows them to retrieve all images from a given folder path.
Looking for advice on optimal services, data structures, and performance considerations.
Thanks in advance for any suggestions or insights!
Solved! Go to Solution.
Hi @MA8731174
To effectively prepare and serve multiple images via an API in ThingWorx, consider the following best practices:
Image Retrieval Methods:
Performance Considerations:
Content Delivery:
Hope this information is helpful.
Regards.
--Sharon
Hi @MA8731174
To effectively prepare and serve multiple images via an API in ThingWorx, consider the following best practices:
Image Retrieval Methods:
Performance Considerations:
Content Delivery:
Hope this information is helpful.
Regards.
--Sharon
HI @MA8731174 ,
The goal might need to be refined a bit, because retrieving all the images from a folder path directly in one go via a clean, fast and scalable API is somehow contradicting in terms. Imagine that the customer would want to retrieve images from all repositories at once, regardless of the number of repositories - if we speak about dynamic data, it is going to be a very hard task regardless of technology. Ideally we would have needed something like this: we plan to let 5 simultaneous users download 40 files (=X MB) at once - a clearer goal overall. As an example: the 10 MB/response itself is not an issue for 5 users, but it will be an issue for 50 concurrent users.
But if we speak about very generic patterns, in absence of concrete end to end numbers, there are several things you should do:
These suggestions are not specific to ThingWorx, but more to heavy IO use-cases and lots of other systems use them.
