What kind of strategy can you recommend for game development?
Now I select nosql database for developing of social game. I know that Couchbase used by Zynga and other big company. And I can't understand some things with Couchbase.
Couchbase stores all keys in memory. So if we take any game like Farm we can see that one user has a lot of keys in game :
- key for user itself,
- few keys for areas (new territories),
- a lot of keys for plants, buildings, fields and other game units.
In general, a single user has an average of around 1000 keys. 1000 keys with 20 bytes length + 160 bytes for meta data ~ 160KB per user in memory without any documents. 100 000 users take about 16GB in memory only for keys, i.e. 100 000 users per one physic server with 24GB RAM (16GB for keys and 8GB for real data and anything else). It's very expensive solution. Gamer can install game and leave it, but keys will be in memory forever. I can't remove his keys, because I don't know when gamer will return.
In MongoDB I can use one big document which contains all game units for user and update it partial. But Couchbase hasn't support partial update. If I'll keep all game units in one or few big documents in Couchbase, I'll spend a lot of traffic.
What kind of strategy can you recommend for game development? Couchbase has a lot of sweet features. I would like to use them.
Welcome any advice and recommendations.