Reputation: 9767
I want to run a server that can rapidly assign game data.
The simple model is:
P1 joins
P2 joins
Make a game with P1 & P2
P3 joins
P4 joins
Make a game with P3 & P4
etc..
but the advanced design is to have logic associated with the pairings.
For example:
P1 (A) joins.
P2 (B) joins.
P3 (C) joins.
P4 (A) joins.
Make game with P1 & P4
etc..
So far I've been using Node + Mongo.js but it seems odd to me to read and write to the database. Is this something that would be better served by using in-memory structures? Should I look at Redis?
I'm looking for efficiency here. It doesn't have to be for billions of connections but should tolerate say, the world's chess population playing speed chess games matching against similar ELO rankings.
Upvotes: 1
Views: 35
Reputation: 46311
Is this something that would be better served by using in-memory structures? Should I look at Redis?
That probably mostly depends on how long your players are willing to wait. It doesn't seem to make much sense to store waiting player persistently, so redis or even a redis without persistence might be a better fit indeed.
[...] but should tolerate say, the world's chess population playing speed chess games matching against similar ELO rankings
Whatever that means... 5M? 10M? Whatever it is, you can get 16GB of RAM at a decent price, so millions usually isn't too troublesome unless you store tens of thousands of bytes per entry.
Upvotes: 1