question

freelancegordon avatar image
freelancegordon asked

Large server-side database possible?

Hi guys,

I'm evaluating Playfab for use in a new project, and the one thing that's currently puzzling me is how we might use your service with a very large dataset we require for our game.

For example, we have a database with about 1.2 million entries, it's not particularly complex, just big. This comprises the data for a quiz game, and we had planned to store that data on a server in order for the server to determine correct/incorrect answers when a player submits them.

From what I can tell the closest thing available on playfab is the title data, but I don't think we want to use the system that way. The other option is to store the database locally on-device and have it as a content file in playfab. Or we could host the database on another server and query it from the playfab server. This might be a harder sell to my boss, though.

But I thought I'd ask you guys to see if this was actually possible and I'd just missed it.

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

It depends upon what all you need stored. From the other quiz games that use our service, one possible model would be:

  • Store all the assets for the questions (audio, video, images, the question details) in the Content service (CDN) along with a "master list" that gives you all the Keys for the question data
  • Store all the answers in distinct groups (so that you can pack many into a single key/value pair) in Title Internal Data (so that the client has no way to access it)
  • Then, when the player submits an answer to the question, you would check it in Cloud Script against the answers in Title Internal Data

If you have more complex requirements that would make it so that you need to use a custom game server as well, you could still use the model above, just replace the Cloud Script with your own server logic.

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.

freelancegordon avatar image freelancegordon commented ·

Thanks for the response, I appreciate it.

That still seems like an awkward way of handling that amount of data, however.

Title Internal Data only allows you 50 entries and I can't see a way to upgrade that. We have 1.2 million entries in this database that we'd need to store this way (that is, 1.2 million answers, excluding questions and other content) and the smallest amount of categories we could cut that down to would be about 30. Which would still be around 40,000 entries each.

I don't know the size limit on a Title Internal Data value, could it hold 40,000 entries of around 20-30 character a piece?

The usage requirements aren't very complex (we literally just need to take a user's input, and see if that exact string exists in the database) but the size of the database means I'm wary of using a system like this that seems intended more for configuration data.

0 Likes 0 ·
brendan avatar image brendan freelancegordon commented ·

We can update Title Internal Data to a higher limit for enterprise customers (and we'll likely be adding an upgrade option to the ala-carte-style upgrades shortly). The max size of a Title Data value starts at 20,000 bytes and can be upgraded up to 250,000 bytes (also part of any enterprise agreement, and we can actually go higher than that if needed, via a custom agreement), and yes, I'd recommend storing it aggregated, as very small Values are inefficient in this model. We'll be updating to a different model that provides for more options with small Values in a future update. But since Title Data is designed to be served to all players, it takes care of all the caching needed to ensure high performance in the scenario described.

It sounds like you wouldn't need a custom game server based on your requirements, so using this via Cloud Script would be the way to go.

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.