How to structure the backend of a multiplayer game [closed] - node.js

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I intend to create a simple mobile question-and-answer game, and some doubts have arisen about the server-side architecture of the game.
As the game will be multiplayer, I intend to use NodeJs and Socket.io, creating rooms for players to play together.
But, how to store the state of each match in each of the rooms?
I thought about saving all the information in a NoSQL database, but I don't know if it's a good idea.
Another idea I had was to use another language that supports multiple threads, creating one thread for each game started and storing the information in variables in the thread. But it also didn't seem like a good idea.
How can I do this? I am a beginner in the field of game development.

Storing things is a database's job, so yes. If your game will have few players you might look for an in-memory database. NoSQL is fine since I doubt you'll be trying to query like "select all players across all current games named Roy" since each instance of a party's game would be pretty isolated from other people's.
Your tech stack is fine.
Threads are rare and are for doing work, not sitting still holding data.

Related

I keep getting errors when I try to make a multiplayer game in python [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have been running into problems recently where the client-side of a networking game never read/recognizes the server. When I tried to use the socket module the client never accepts the socket. I used a module called NetworkZero, but that never returned more than None when I used .discover(). I have no idea what the problem is. Any ideas are appreciated
There are many ways to set up an interface between clients and servers.
The easiest is probably to start with HTTP especially in Python where you can just use requests and poll for your data.
This will get you to prototyping quickly and then you can put your focus into optimizing when you start running into issues.
Of course this may be a less than optimal solution depending upon the nature of your game. Without context I would recommend using simple client/server communication systems you understand.

What are common issues with sequelize [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I've been considering using node/express/sequelize for a project but I've read in a few places where people strongly advise against using sequelize as an ORM. Can someone advise me on the major reasons why people say not to use sequelize?
For clarity, I'm using postgres as a database for relational data, not no-sql
It happens to be that MySQL is not part of the opinionated MEAN Stack. There was a revolution against the strict schema types of SQL, and started a NoSQL revolution. MongoDB earned its position in the MEAN stack, and the rest is history. As far as I'm concerned, it's just an opinion. If you need strictly structured data and your backend uses MySQL, you'll be fine, don't listen to all the hype man. Remember, these are tools we are using.

Distributed file system for linux [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I've got a web app where I use plain file system for my custom logs - a lot of small files, I don't want to put that into db, that works for me quite well. But now I need to scale my app by using a load balancer in front, so I also need to keep those logs in sync between servers. Is there any reliable solution for such cases ? I know I could sync it by some OS means, or by scripting, but I'm thinking if there is any better solution for such scenarios? Is it the case for MongoDB usage or something more modern or is it better to keep it on file system as plain files ?
This questions is going to get you some heat since essentially your asking for our opinion. Ill be frank tho and wont argue with anyone since its just MY opinion. With web apps in my humble opinion, its always better to keep your data in a DB for scalability but also for analytical research. I know little about what your app does but its easier to write third party data apps that tell you how many of X or Y etc when its centrally stored in a DB. Since the app that gets said data can be anywhere. I know I probably wasted time with an argument but hey, hope I helped a bit.

What is the philosophy to determine client/server rendering (Nodejs) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
When playing with NodeJS, I came up with this question, since one can now put some code either on client side or server side using even the same language.
E.g. For a small game app, I can put the computation on client side when interacting (via some onclick function); also I can initiate a server request and do the computation there.
With more investigation, the terminology for my question is client vs server side rendering. Now there's a lot of materials I can find.
It's basically a tradeoff, depends on the user case, server capacity, etc.
The best philosophy for deciding what is left to the client and what is left server is often to leave as much as possible up to the client. While this often does not apply to very complex applications, most applications can apply this with no negative effects.
The logic here is that 1 dedicated computer (the client) can handle its' individual needs (such as images, video, gameplay) much easier than 1 or a few servers can handle 1000's of client needs.
However, some things require an external application (the server). Good examples of these are sessions, leaderboards, user authentication, and social media integration.
The only downside is that it may increase your applications initial load time. For small applications this may only be milliseconds. For larger applications, that take more than 2-3 second to load, I would say add a loading bar.
Cheers
-Nick

Can you use couchDB for web apps like ebay? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I mean, can you use couchDB for:
CRUD of items, users
bids and auctions resolutions
bidirectional califications
forum
items comparison
You could try to use CouchDB for an application - as to whether you would be successful is another question.
Something on the scale of eBay will have special requirements that are not representative of a typical application, If you are building a small auction site then perhaps CouchDB would suffice. A document-oriented database like CouchDB may not be so hot when you have to deal with transactional/records-based data like that associated with auctions.
I think couchdb would be excellent for part of the problem, though there are a few elements that would not be great. Particularly, eventual consistency over distributed nodes seems really bad for real time bidding.
You could keep the the item and user info in CouchDB, along with forums and a lot of that sort of stuff, but some functionality (bid tracking, search) would be more suited to other backends. As an example, the CouchDB guys are looking at tying CouchDB into other tools (like SOLR) for indexing, etc.
I would look to see how Amazon uses SimpleDB internally (or do they?). Might have some clues as to right ways to use a document-based database.
As you can see here they are indeed using non-relational approach, so I guess you're heading in a correct direction (flexibility-wise at least).

Resources