在具有许多连接的数据库中快速分配游戏管理

Rapidly assigned game management in a database with many connections

我想运行一个可以快速分配游戏数据的服务器

简单模型为:

P1 joins
P2 joins
Make a game with P1 & P2
P3 joins
P4 joins
Make a game with P3 & P4
etc..

但高级设计是让逻辑与配对相关联。

例如:

P1 (A) joins.
P2 (B) joins.
P3 (C) joins.
P4 (A) joins.
Make game with P1 & P4
etc..

到目前为止,我一直在使用 Node + Mongo.js,但读取和写入数据库对我来说似乎很奇怪。使用内存结构会更好吗?我应该看看 Redis 吗?

我在这里寻找效率。它不一定是为了数十亿的连接,但应该容忍说,全世界的国际象棋人口都在玩与类似的 ELO 排名相匹配的速度国际象棋游戏。

Is this something that would be better served by using in-memory structures? Should I look at Redis?

这可能主要取决于您的玩家愿意等待多长时间。持久存储等待的玩家似乎没有多大意义,因此 redis 或什至没有持久性的 redis 可能确实更合适。

[...] but should tolerate say, the world's chess population playing speed chess games matching against similar ELO rankings

那是什么意思... 5M? 10M?不管是什么,你都可以以合理的价格获得 16GB 的 RAM,所以数百万通常不会太麻烦,除非你每个条目存储数万字节。