question

nickpruehs avatar image
nickpruehs asked

Storing an arbitrary number of similar player data records

Hey everyone,

after taking a deep look at the available services, I'm stuck with the following scenario:

We'd like to store an arbitrary amount of player data records, more specifically, the match history of a player. Whenever a player finishes a match, we'd like to store

  • date and time of the match
  • whether he won or lost
  • other custom data, e.g. the map he's been playing

Players should be able to retrieve their Match History, in other words the most recent records, at any time.

It seems like using player statistics is not a fit for this feature, because we want to store several key/value pairs per entry, instead of accumulating the results. I've also thought about abusing the player inventory for this purpose, but then again we'd need to store custom data on a per-entry basis (e.g. date/time of the match).

The closest thing to use seems to be PlayStream events. Then again, these cannot be retrieved later again, especially not by clients.

How should we approach this feature?

Player 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

·
Joshua Strunk avatar image
Joshua Strunk answered

So I would start by turning that arbitrary into a defined feature set. I would really think about the way the player will be interacting with their match history. This will inform the sort of solution you want to use.

You are not going to get a solution allowing for storage of an arbitrarily large data set through PlayFab without some sort of custom usage based contract.

PlayStream events are, as you have discovered, great for this kind of job. Better, you can pair them with CloudScript triggers to archive data off into a more custom solution. Your own DB for example.

You can easily store a more limited and defined history of a players matches in a user's player data. With the amount of data you describe as needing per match, you could possibly store the past 100 matches as compressed JSON in a single key/value pair. You could even trigger updating this storage through a Playstream event.

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.

nickpruehs avatar image nickpruehs commented ·

Thanks, we'll do that! :)

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.