- Home /
Question is off-topic or not relevant
Using a database for unity multiplayer project
Hello all,
Which is the best database tool for using with unity for multiplayer game?
Anyone experienced with MongoDB ot SQL? Which is better?
Thanks!
Answer by Bunny83 · Mar 12, 2019 at 09:54 AM
This is off topic and too unspecific. "Multiplayer game" is a way too broad term. FPS games don't really need any backend DB. So lager scale games (MMOs, etc.) generally have a completely seperated server architecture. Unity is mainly for the frontend and in many cases not suited for the backend (though it depends on the game).
A database generally is just a place to store data in a structured manner. It's like asking if it's better to use a HDD, SSD, USB mem stick, floppy disk or a tape drive. It entirely depends on the usage and the requirements. Tape drives are still used today to do backups since they are more reliable in the long term. SSDs and mem sticks have limited write cycles, floppies are slow as hell.
Without knowing the usecase, which data needs to be stored, how that data needs to be queried, how frequently you access that data, what interface you want to use to access the data, ... it's impossible to tell which system may better fit. None is generally better than the other. It's like comparing a ferrari against an excavator. Both are good in their fields.
Apart from all that unspecificity this is not a Unity related question. Server side database systems is a general programming field and the design of a database a whole topic on its own.
Unity Answers is for specific unity related questions that can be answered. Any sort of discussions, opinion, feedback, recommendations should be handled on the Forums.
thank you for your feedback @Bunny83 It's my first time as a full stack developer and I'm only experienced with using UNET so far. In this case I'll specify my needs: 1. Connect the player (email registration /login) 2. send simple stream of bytes, as simple as : if user A picked red cube -> then user B see yellow cube in her scene.
$$anonymous$$y plan is to use $$anonymous$$ySQL for the database (registration / login), first local when developing and maybe set to the cloud in the future, and simple TCP connection between the two players (only two players now)
As you can see its not even a FPS, I don't need to update the transform or animation of the players, but to enable and disable objects once player A or B completed their task.
It seems fairly simple to me and yet feels complicated and I start learning about dedicated servers and creating a local database.
Also I think it's related to Unity because I'm not accustomed to writing c# outside unity and to me the integration is very important. For example there is a unity package for SQLlite... that I thought is good, but after checking further I realized it's really pretty much the same: table of content which can be transformed between databases.