2022.11.08 03:29 PM
Hello,
Here is my use case: I am trying to build a dashboard where each user can construct a dataset S for viewing, and user can further interact with S using various controls. Here are the problems I have:
- although S itself is small, computing S takes significant amount of time, and there are various interactive components on the dashboard that depends on S as data source so they need to query S over and over again
- S is different for different users
My idea for solving these problems is to cache S for all users on the server side, and for each user, once they compute their S, they can just looked up the cached S every time they need S again. However this solution would require the server being able to send a key for S back to each user, and I have yet to find any documentations on how KX dashboard could use data returned from server as value to assign to view state. Did I miss something or is there a good reason for not having this capability? If the latter is the case, what other solutions can I try for my use case?
Thank you very much in advance!
2022.11.11 09:19 AM
Hello @yuwu10112358
Thanks for sharing with the KX Community.
Reverting with some feedback for you:
There are a few options here:
1. Server side caching solution is recommended.
2. Use a virtual query. If several components are using the same datasource, then there can be one q query and link each of the components to a virtual datasource
3. In the query, return the table as a dictionary and use the query mapper to map the table to a viewstate
Hope this helps.
Thanks,
Leah
2022.11.14 07:57 AM
2022.11.11 09:19 AM
Hello @yuwu10112358
Thanks for sharing with the KX Community.
Reverting with some feedback for you:
There are a few options here:
1. Server side caching solution is recommended.
2. Use a virtual query. If several components are using the same datasource, then there can be one q query and link each of the components to a virtual datasource
3. In the query, return the table as a dictionary and use the query mapper to map the table to a viewstate
Hope this helps.
Thanks,
Leah
2022.11.14 06:10 AM
Thank you for the feedbacks! Sorry if this is a dumb question, but what is a query mapper?
2022.11.14 07:57 AM
2022.11.14 08:00 AM
Ah I see very nice. Thank you!
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.