Hey all, just got a question about keeping data across paper servers consistent and saving it.
Currently a server I dev on (RPG-style) is 1 paper main server.
We’re looking to split into multiple different servers - each server being a different part of the map. All servers, the database and Waterfall proxy would be on the same dedi.
Certain data needs to be synced across the servers, such as custom statistics and data that needs to be the same across the servers. I’m thinking the best way to do this is create a socket that all the servers listen to.
When a player joins the proxy, load their data from the SQL (if they are not pending having data uploaded, explained below) and send it in a json format to all other servers, overriding any data they may already have about the player.
When a player leaves a paper server (either to leave the network or swap to a different paper server), send their data in a json format to all other servers (including the proxy). This would override any data that other servers have about the player (I’m aware that the join event on the new server is fired before the quit event on the previous, hence the data overriding). The Proxy would read the data received and asynchronously update SQL in a batch process - maybe using a scheduler to do it > every 30 seconds or so. The data waiting would be in a map where their uuid is the key, if the player joins whilst data is waiting to be updated for them, this data > would be sent to all servers instead of querying the SQL - as this would be most up to date as oppose to what’s in the SQL.
So after the player joins the proxy once, every server always has the most up to date information about the player.
We currently average 20-60 players, so it needs to be able to handle this (and hopefully more in future).
Just wondering if this is the best way to go about it, and if it is: should each plugin that requires it get it’s own socket or should there just be 1?