Is storing player in-game purchase history with datastores viable?

So I want to implement a system where it would log any in-game purchases, in-game matches, other actions, etc that the player makes and then log that via datastore. Would this be viable, as in, would there ever be an issue with hitting the 260,000 character limit?

1 Like

I don’t think this would be an issue but try to keep data saving to a minimum. Why do you want to store in-game purchase history?

The 260,000 character limit is rarely hit unless it was unoptimized data store writing. You would use a classic and separate data store(or DataStore2, whatever works) and save per player’s ID their purchase history and optionally, other data by assigning the purchase as a key instead of value.

1 Like

Completely viable, but not in the way you’re going about it. Don’t store purchase history along with player data, otherwise you’re going to easily trip the 260K character limit. If you handle purchase history separately, then you should never hit the character limit.

The idea behind purchase histories is that you want to prevent a purchase from being granted twice so you’re only saving a boolean, true specifically, for 4 characters. All the ProcessReceipt code does is check if the purchase has been logged before and if it is, then implicitly pass that it was granted.

You can see this example right from the Developer Products article:

3 Likes