Hi,
I’m working on reading and writing storage objects.
My game has a lot of things to save (coins, gems, player profiles that have a lot of variables by themselves, and many more).
I have some questions and some scenarios about it.
Senario 1:
Q1. Is it better to have a unique collection and key for every single player that saves all variables on it?
For example, I have cl_1 collection key_1 key for player 1,cl_2 key_2 for player 2, and … those whole variables should be in general.
public class general{
public int coin;
public int gem;
public Profile Profile;
and many more ....
}
public class Profile{
.....
}
the general class use for parse json from server (for read and wirte)
Senario 2:
Q2.Is it better to have a lot of collections and keys for every variable that should be saved on the server?
For example, I have coin collection = C_COL with key = C_KEY that every single player coin should be saved in this collection.
For every single variable, I make a collection and a key. In this scenario, I should use a lot of separate classes.
public class Coin{
public int coin;
}
public class Gem{
public int gem;
}
public class Profile{
public int profile;
}
and many more classes that should be make seprate (for parse json from server)
I have 10 million active players (for example), so
Senario 1: have 10M database rows with very large json response save and load from every single player. I think it should be easier to search between 10 million users and find whole user data. However, it may take a long time to save and load data on the server (a lot of server resources are used for saving and loading data).
(I’m not sure about this.)
Scenario 2: has 1000 database rows (for example, whole variables are 1000) and each database row has 10M database rows.
I believe that searching between 10 million users and 1000 variables to find every single user’s data should be more difficult, but the json response time for save and load is very short (using a lot of server resources for searching and finding data).
(I’m not sure about this either.)
My goal is to use very low server resources because I have a lot of players (for example, 10 million) and want a fast server response.
FinalQ: Which one of the above scenarios is better?
MoreQ:Have you got a better scenario for a game that has a lot of variables that should be saved and loaded on the server?
About my game: Racing, 3D, developed by Unity Engine, no battle royal mode yet, but will be added in the future, and a maximum of ten players per match.
I’d appreciate any help.
Thanks in advance.