question

HectorRodriguezFigueroa avatar image
HectorRodriguezFigueroa asked

How to reliably get consistent contents of catalog using ParseServer.GetCatalogItems API

I have been trying to use this api to get and cache a titles catalog content to have available the details of store items on my server like suggested in several posts in the forums (e.g. https://community.playfab.com/questions/10428/how-to-get-display-name-of-store-items.html). However after some testing and investigation I have ran into the scenario where calling PlayFabServer.GetCatalogItems right after an update to the catalog happened, to query the catalog's content (whether using Node.js sdk in response to a stream event webhook request, or manually after update of the catalog in the title manager ui and using something like curl or postman) the items I get back in the catalog have stale values for the first x number of requests until it all converges eventually to the expected values. It feels as if my requests are being serviced by a pool of resources that are assigned to handle them in a non deterministic way, and they all return to me the last result they have available for my request if they have something and then update themselves. So its not until I'm able to hit all of the resources in the pool and have them update their cache, that I get a consistent result. Just a guess, but hopefully that is descriptive enough of what I'm experiencing. Is this by design? Is there a way that I could be notified when eventual consistency has been reached. Is there an amount of time I could wait where there is some sort of guarantee that the items in the catalog will have consistent and up to date data? Like a cache TTL? It seems like if I wait long enough (say in the scale of minutes) it works but just want to have confirmation of this. I don't just want to throw down a hammer to make it work based on a guess, trying to actually do things right. Again, the hope was that there was a way for my server to get this info during bootup and use it and only update it say when we get a webhook from soemthing like an event com.playfab.title_catalog_update. But maybe Im just not using this correctly. Not sure. Can anyone please help me figure this out? Thanks.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

Any data source that needs to server potentially millions of players (many all at once) is going to be sharded and cached - our catalogs and Title Data are examples of this. So yes, there are many servers that host the data for your catalog, and when you update the catalog, it's going to take some non-zero time to update all those servers.

We're actually in the process of making some updates to the commerce system for overall performance, but right now you should expect that there could be up to 1-2 minutes where an update is propagating across all the servers.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

HectorRodriguezFigueroa avatar image HectorRodriguezFigueroa commented ·

Got it. Thanks :)

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.