Unity3d and Node.js backend
I have a question about using Unity3d with Node, Express and MongoDB. I want to make a backend to my game. Server should send to client some stuff like how many coins they have, levels, items and all that stuff that is stored in database. BUT i dont know what should i use. Socket.IO or HTML POST/GET? I think Socket.IO is better for realtime application like chat and things like that but for just getting and sending data to database html is enought?
Answer by maxgreen · Oct 27, 2015 at 09:27 PM
Your observation is right. Socket.io is for full-duplex, communication intensive applications where the clients exchange data frequently with the server and vice versa. This would be useful in an MMORPG or MOBA game. But if you just need to do a few requests (say about 100) during a single session of 5 minutes, then HTTP GET/POST is the way to go.
Answer by dstovell · Feb 05, 2016 at 06:13 PM
Hybrid solutions are good too. You can use HTTP GET/POST with a socket channel to send small messages signalling the client some event happened, or to update its data via HTTP.
Your answer
Follow this Question
Related Questions
Using Unity's WebGL export in Node.js 0 Answers
Unity doesn't see the disconnect from the server when called by another Unity, any ideas? 0 Answers
Failed to start UnityPackageManager Node.js Problem 1 Answer
Difference in script compilation in BuildStreamedSceneAssetBundle vs BuildAssetBundles 1 Answer
Unity Annoyance with Physics Help C# Scripting Problem Momentum Issue Please Help 0 Answers