My multiplayer game stores player’s data using Firebase Database. There is a free plan with 1GB of free data stored and 10 GB downloads a month. I would like to stay in that program as long as possible. Currently, this is how the player’s stats are stored in the database :
Kills | Deaths | Assists
0 | 0 | 0
The data is uploaded/downloaded after each game, on average each 10min and for around 10 players. I want to know if storing the data in a list instead of a variable for each stat costs less to download/upload/store ?
Something like this :
Stats
[0,0,0]
Is downloading/uploading a list faster ? Is it less heavy to store ? Thanks in advance.
You may get better answers if you post this in a Firebase related forum.
Does Firebase give you any way to measure it? I‘d research in that area, ie „optimize firebase traffic“ or similar.
Well, it’s more of a general question about databases, but I’ll try asking in their forums too. Measuring myself would take a bit of time to set up and I might mess it up. I prefer asking first because somebody probably already have experience with this. Thanks for the answer !
I understand, but this may depend a lot on how Firebase measures traffic internally. Like phone companies, who often do not charge in fractions but per megabyte, so even if one day you only have 10 bytes of traffic, it would amount to 1 megabyte of traffic because the company rounds it up to the nearest megabyte every day (or hour, or even minute). Firebase may or may not do a similar thing.
On top, if you have just those three integers or perhaps if these are counterstrike-like game sessions these could even be bytes assuming it is extremely unlikely to amount over 255 kills per session. So you have three bytes of actual data, but the communication overhead might be hundreds of bytes due to how data is transferred and whatever else may need to be communicated (login, account info, client identification, hashes, and such). Then again, Firebase may simply not count those as traffic and just count the raw values that go into and out of the database.
I’d say: use the format that’s easiest to work with. You probably will be happy to run into traffic issues eventually because that means your game is doing (and selling) well.
oh that’s interesting, I didn’t really know about this. So they probably know better you’re right. I’ll wait for their response in the forum and keep it as it is for now. Thanks for the explanation !