You could use something similar to this technique, described by Nick Johnson:
http://blog.notdot.net/2010/04/High-concurrency-counters-without-sharding <http://blog.notdot.net/2010/04/High-concurrency-counters-without-sharding>Basically you use memcache to store the most current game state, and persist it only periodically to the datastore, using a task. On Tue, Feb 8, 2011 at 12:41 AM, Mark <[email protected]> wrote: > Hi, > > I wrote a turn-based game. I added a multiplayer component to it, > using app engine as the backend. It's working fine, but the cpu costs > are probably going to be too high. I tried to make every optimization > possible, and I got a basic game move down to ~140ms in total (trip to > datastore, modify game state, persist back to datastore). A game > usually takes about 4,000 moves to complete. I'm storing the gamestate > as a flat json string, which has been working very well (each game > consists of about 4 to 10 players, one gamestate object per game). > > For the purposes of a game application, it would be really nice if > memcache supported a notification handler we could implement when an > object is getting evicted. So, if I kept all my gamestates in > memcache, I would only ever persist back to the datastore if memcache > notified me that an object was getting evicted. Otherwise I could > avoid going to the datastore at all. This has probably been brought up > before and purposefully not implemented. I'm using memcache, but have > to write back to the datastore any time a user modifies gamestate. > > A game of this nature is probably not the best use-case for app > engine, but wanted to give it a shot for fun, cool platform, > > Thanks > > > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
