NoSQL数据库的实时,双玩家Facebook游戏 [英] NoSQL Database for real-time, two-player Facebook Game
问题描述
我正在开发一个实时,两个播放器和回合制的Facebook游戏。我几乎完成了包含游戏机制的JavaScript代码,但我仍然没有将游戏实现为双玩家和实时。
I am in the middle of developing a real-time, two player and turn-based Facebook Game. I have almost done the JavaScript code that includes the mechanics of the game but I still don't have the game implemented as two player and real time.
我已经阅读了一些文章和一些问题说,MySQL数据库不是我需要的。我需要使用NoSQL。我想问建议,这些都是要考虑的事情:
I have read some articles and asked some questions that say that MySQL database is not what I need. I need to use NoSQL. I want to ask for suggestions and these are the things to be considered:
- 玩家在Facebook上,所以我需要显示他们的朋友,指示朋友是否已经玩过游戏。
- 我还需要实现实时游戏请求发送。这是一个双人游戏和回合制的游戏,所以,玩家1必须首先要求玩家2的权限,才开始战斗。
- 我也想存储玩家的游戏信息。我想包括黄金,物品和能量的东西(像大多数着名的Facebook游戏)。
- 我在本地计算机上运行Windows,我将使用它作为我的测试服务器。但我计划在未来有一个基于Linux的服务器。因此兼容性仍然是一个问题。
- Players are on Facebook so I need to display their friends, and indicate whether a friend has already played the game or not.
- I also need to implement a real-time game request sending. It is a two-player and turn-based game so, Player 1 must ask Player 2's permission first before they go for a battle.
- I would also want to store players' game info. I want to include gold, items, and energy stuff (like most of the famous Facebook games). These details must be updated real quick as the players play and achieve some goals.
- I am running Windows on my local computer and I will use this as my test server. But I am planning to have a Linux based server in the future. So compatibility is still an issue.
推荐答案
我会考虑使用 Couchbase 。它很容易运行/管理。它使用JSON进行数据存储,这对于基于Javascript的应用程序非常有用,因为它是本机数据结构。
I would consider using Couchbase. It is easy to run/manage. It uses JSON for data storage, which is great for Javascript based applications as it's a native data structure.
它在游戏公司中非常受欢迎。它闪电快(它的memcached +持久性在一个单一的层,所以我们说的RAM速度)和超级容易超级。您仍然需要在Couchbase之前构建REST API服务以满足您的需求,但是由于模式是灵活的,因此构建数据模型是一件轻而易举的事。
It's very popular amongst gaming companies. It's lightning fast (it's memcached + persistence in a single layer, so we're talking RAM speed) and scales super easily. You would still need to build a REST API service in front of Couchbase to serve your needs, but since the schema is flexible, it is a breeze to build your data model.
如果您需要帮助,请告诉我 @ scalabl3 a>。
If you need help figuring that out, ping me @scalabl3.
这篇关于NoSQL数据库的实时,双玩家Facebook游戏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!