I'm developing a game that consists of many mini-games. We want the user username to be recorded and saved. Also, each time the user plays one of the mini-games, some reports for that specific mini-game played should be saved on the server referring to the username.

So, we now save user data on the server, but I think in a way that is too dirty.

On the first-time login, we get the username, I made a PHP file on my DirectAdmin server that checks if a posted username folder name already exists. If not, the PHP file will create a folder with that username.

Then, every time the player plays a mini-game, that specific report is uploaded to the user's folder that was previously created (the report for each mini-game played consists of its time length, number of correct answers, wrong answers and some other parameters like this).

What I now want, is to do some queries on user data, but with this kind of saving it's not possible. Even worse, when the number of users grows, the number of folders created will become too high, and I have performance concerns.

What is the solution to my challenge? Should I use some game backends like GameSparks or something?

  • \$\begingroup\$ Why do you want to keep player's progress on the server? \$\endgroup\$
    – Vaillancourt
    Oct 26, 2021 at 23:40
  • 2
    \$\begingroup\$ I notice you've tagged this question databases, so it sounds like you already understand that a database is exactly the technology that solves this problem. How have you tried implementing a database using your research into the topic so far? \$\endgroup\$
    – DMGregory
    Oct 27, 2021 at 0:54

1 Answer 1


Using some kind of database framework seems like the right approach. You could use SQL or something similar right in your own server, or interface with a database service like Amazon or Google. Using a third party service means fast and huge storage and less worry about low-level details, but you have to pay and have to learn a new API. Self hosting is complex and more time spent working on low-level tasks. But then you have more control and it’s probably cheaper.

Although as your storage/ access needs grow beyond a certain threshold the third party options might actually become cheaper.

As @DMGregory noted. Beware of storing sensitive info!


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .