【发布时间】:2012-09-11 07:10:33
【问题描述】:
我有一个正在使用 MySQL 的在线游戏。我有一个如下所示的 Player 表:
create table player (
id integer primary key,
name varchar(50),
score integer
);
我在“分数”列上有一个索引,并显示如下排名:
select id, name, score from player order by score desc limit 100
我想将我的系统迁移到 Redis(或者,如果其他 NoSQL 更适用于此类问题,请告知)。所以我想知道有什么方法可以有效地展示这种排名表?
AFAICT,这可能是 Map/Reduce 工作吗?我对 Map/Reduce 几乎一无所知,尽管我阅读了一些我仍然不太了解的文档,因为我无法找到任何现实生活中的示例。
谁能给我一个粗略的例子,如何在 Redis 中进行上述查询?
【问题讨论】:
-
你可以考虑 orientDB(一个 noSQL 衍生工具,设计得非常好)code.google.com/p/orient/wiki/SQLQuery。他们提供了一个 LIMIT 命令