question

redletterday avatar image
redletterday asked

Syncing Database Across Many Dedicated Servers

Hello.

I'm just getting started on a fairly large open-world project and am in the process of exploring different back-end development packages. I had a couple of questions regarding the Playfab service and if it is capable of accomplishing what I have in mind. I am currently working in Unreal and would prefer to stay there, however I'm not opposed to swapping over to Unity if it will make my life significantly easier.

The basic gist of the structure I am envisioning is a large amount of interconnected maps/levels, each hosted on an individual dedicated server running pretty much 24/7. Players can jump from one map to the next via defined portal points on each map. This much I have figured out how to accomplish in UE4 and have no problems with. What I am concerned with however is managing a database structure that will be synchronized across all of these servers. When players transfer servers the database needs to be able to preserve attributes, inventories, experience, basically everything and reload them upon new map entry.

Is this something that is currently possible with the Playfab service or wishful thinking on my part?

Thank you.

dataCustom Game Servers
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

For the scenario of one server making a few calls to update the player state, and then another reading that player state, that's easily supported, assuming the player isn't going to be jumping between these servers at a high rate (like every few seconds). The PlayFab data would effectively be your long-term storage of the player state, with the servers managing the high-speed frequent query work of talking with the player (periodically updating the PlayFab data, to keep it from getting too out-of-date).

But my question would be, how are you storing the world state data that isn't player specific? Where are you storing that and how often is it updated? What's the recovery logic for if one of your servers falls over?

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.

redletterday avatar image redletterday commented ·

Ideally there wouldn't be a reason for players to be jumping between zones every few seconds. I guess there's nothing to stop them from doing so but I don't know why they would. To be honest I haven't even begun approaching aspects such as server failure contingencies & security. I'm a film & TV vfx artist & animator by trade so I'm kind of just learning as I go trying to tackle one issue at a time. Once I was able to get my test servers up and running with multiple connections and transferring, I figured the next logical step would be trying to synchronize a database for player info as well as a login system.

I'm not sure if I'm understanding what you're asking correctly but I'm having a hard time visualizing data that's not tied to a specific player. Things like NPC AI would be managed by each individual server, so if one were to fail I imagine it would just be a matter of that area being inaccessible until whatever system I had in place launched a new instance of the server. Again this is all hypothetical and far ahead of where I currently am, I just wanted to confirm that Playfab was capable of handling the player data synchronization before I spent too much time delving into it

0 Likes 0 ·
brendan avatar image brendan redletterday commented ·

Yes, it's things like NPCs that I'm curious about. Basically, you'll need to manage the state of the simulation on the server since you'll need to have that all in an in-memory data table to manage all the transactions. It's possible you could use Title Data as a way to have a longer-term store for the state info, but only if each Key/Value pair is being updated by a single source at a time, and only very periodically. It's a sharded and cached resource space (so that it can serve requests from all players), so it takes a non-trivial amount of time for all endpoints to be up-to-date.

Either that, or you could (assuming it's only ever read by the server) use Entity Files to store that data. That would probably be the better way to go, really.

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.