question

Matt Newell avatar image
Matt Newell asked

,Is there any memcaching used (eg Amazon ElastiCache)?

Suppose I wanted to use PlayFab for a game like Pokemon Go. Every X seconds the server will be updated with the player's location--but writing this location to a database every time would be neither performant nor frugal. It's the same situation for picking up items--if a character in an RPG picks up a dozen pieces of loot in a minute, we don't want to do a DB write every time.

This is typically solved by writing the data to memory, marking the state "dirty" so we know there's data that needs to be written, and periodically flushing this to the database (at regular intervals and when a signficant action is performed, such as selling an item or attempting to log out).

Is something like this possible with PlayFab? What are the recommended practices for the scenarios described above?

data
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

Correct - data table writes in an online service shouldn't be treated the same way they are with a database that lives solely on the client device, as that's not scale-able or performant. If you were to attempt to update with that kind of frequency right now, you would quickly run into our rate limiting logic.

The way to do this now would be to use a custom game server for high-frequency state changes in your game's data, with that server periodically updating PlayFab with the latest information for the player.

We are looking into the possibility of providing an in-memory solution similar to what you describe in a future update, but we don't have a specific schedule for that as of yet.

2 comments
10 |1200

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

Matt Newell avatar image Matt Newell commented ·

Are the rate limits for Pro documented somewhere?

0 Likes 0 ·
brendan avatar image brendan Matt Newell commented ·

Not currently, but we'll be providing more details on all limits as part of finalizing our pricing update.

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.