how to architect achievements and badging with nosql how to architect achievements and badging with nosql mongodb mongodb

how to architect achievements and badging with nosql


This is a good candidate for running map reduce on the database. you can run them on a less regular basis, using them for offline computation of the data that you want.

http://www.mongodb.org/display/DOCS/MapReduce

You could use other tools to do this, but in your summary i cannot see any compelling reason to add complexity at this stage. I would explore map reduce, try it out and then if it does not meet your needs, expand your options. but at that time, you would at least have identified concrete bottlenecks, if any.


Just some notes on using a graph-db like Neo4j. As your badge information is always? queried for a concrete user these are local and not global queries.

So if you can model your domain as network of objects (as it perhaps already is) and express your badge logic as a set traversals or graph-queries starting at the user then it works without persisting them as local graph queries are fast enough regardless of data set size.

Easiest thing is to create a time-boxed PoC to see if that works for you. Cross-connecting the two stores by storing your user-id in an graph-db index and as property on the node should work fairly easily. You can sync the db's on the commit/save hooks or asynchronously. Perhaps it would be sensible to move other "social-network" data into the graph as well and keep the game data + documents in mongodb.