问题
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.
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:
- 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.
回答1:
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.
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.
If you need help figuring that out, ping me @scalabl3.
回答2:
check rethinkdb, is use to realtime.
Use cases where companies benefited from RethinkDB’s realtime push architecture include:
Collaborative web and mobile apps
Streaming analytics apps
Multiplayer games
Realtime marketplaces
Connected devices
来源:https://stackoverflow.com/questions/17936809/nosql-database-for-real-time-two-player-facebook-game