The server side logic that we are implementing requires lookups into various tables and some calculations against that data. The data itself is reasonably static and an ideal candidate for caching so I am wondering what is the recommended way to do that with GameSparks? I'd rather not run mongodb queries every time i need this data.
An example would be a loot table. If I were setting up my own backend, i'd have this loaded into a cache on the vm that could be accessed locally without having to hit a db (except for vm initialization). The data is shared across users and needless to say this provides excellent performance.
Any help greatly appreciated, thanks!
Thanks! - Toby
Best Answer
T
Tech Support
said
about 8 years ago
Hi Toby
All calls to metadata collections within cloud call are already cached by the platform. If it's a call to a metadata collection your mongo query will only go to mongo if the query results have not already been cached.
All calls to metadata collections within cloud call are already cached by the platform. If it's a call to a metadata collection your mongo query will only go to mongo if the query results have not already been cached.
Gabriel
T
Toby Gladwell
said
about 8 years ago
Thanks for the response Gabriel,
I'd like to get a little more detail on the caching mechanism if possible. Are the cached queries located on the same vm that the cloud code is being run on (i.e. something similar to memcached) or is there a network call involved?
Thanks again,
- Toby
Tech Support
said
about 8 years ago
Hi Toby
This is an in memory cache on the cloud code VM's. The cache is flushed when a game publish event occurs.
Toby Gladwell
Hi there,
The server side logic that we are implementing requires lookups into various tables and some calculations against that data. The data itself is reasonably static and an ideal candidate for caching so I am wondering what is the recommended way to do that with GameSparks? I'd rather not run mongodb queries every time i need this data.
An example would be a loot table. If I were setting up my own backend, i'd have this loaded into a cache on the vm that could be accessed locally without having to hit a db (except for vm initialization). The data is shared across users and needless to say this provides excellent performance.
Any help greatly appreciated, thanks!
Thanks!
- Toby
Hi Toby
All calls to metadata collections within cloud call are already cached by the platform. If it's a call to a metadata collection your mongo query will only go to mongo if the query results have not already been cached.
Gabriel
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstTech Support
Hi Toby
All calls to metadata collections within cloud call are already cached by the platform. If it's a call to a metadata collection your mongo query will only go to mongo if the query results have not already been cached.
Gabriel
Toby Gladwell
Thanks for the response Gabriel,
I'd like to get a little more detail on the caching mechanism if possible. Are the cached queries located on the same vm that the cloud code is being run on (i.e. something similar to memcached) or is there a network call involved?
Thanks again,
- Toby
Tech Support
Hi Toby
This is an in memory cache on the cloud code VM's. The cache is flushed when a game publish event occurs.
Gabriel
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics