No. The GAE documentation is explicit: There is no guarantee that your data will exist in the memcache even 1s after putting it there.
Will it be there? Most likely. But that's not very comforting given the time and energy required to develop an online game. When your system starts behaving badly, the only response you are going to get from GAE support is "our system is behaving as documented". The exact algorithm for allocation of memcache resources is not public and can probably change at any time, but you're sharing it with everyone else. Even if your app is treading lightly in the memcache, that doesn't mean everyone else is. Even if memory pressure is not the problem, your memcache data could disappear simply when G decides to pull a server or roll out a new version of memcached. Also consider that you will need to build your game with only the most basic synchronization primitive - increment(). I'm sure you can build higher level synchronization mechanisms out of this primitive but with the number of RPCs involved they're going to be really, really slow. I'm a dedicated fan of Appengine but I've also worked on MMO games in the past. Unless your definition of "realtime" is very lax, Appengine is just not the appropriate tool for the job. You will spend *far* more engineering resources working around GAE limitations than you would spend setting up a traditional appserver like Resin, Glassfish, or JBoss. Jeff On Sun, Apr 18, 2010 at 7:14 AM, Phuong Nguyen <[email protected]> wrote: > A rack server could be purchased anywhere. However, I want to > streamline my development and it would be best to build every thing on > GAE structure. Given I want to store real-time game data using > memcache, If I strictly maintain number of objects stored in memcache > (thus, limit the use of memcache to certain size), then will my > memcache be available even if the app is restarted on another server > in the cloud? What is the probability that my data in memcache get > lost during normal operation (given I will not let memcache data > expired)? > > On Apr 18, 12:57 am, Jeff Schnitzer <[email protected]> wrote: >> You should never put something in the memcache that you don't mind >> losing when the memcache service flushes your data. Players are >> probably going to be very unhappy if their scores and current >> positions suddenly disappear mid-game. >> >> GAE is just not an appropriate platform for a realtime game. You can >> do turnbased games, or games that have a slow update period (using the >> datastore), but GAE doesn't provide the bread-and-butter of realtime >> games: persistent socket connections and singleton in-memory data >> structures. >> >> You could spend months working around this problem with XMPP and >> hacking together a fragile solution on top of memcache, or you could >> just spend a few bucks a month on a more traditional server >> infrastructure running elsewhere in the cloud. A 256M slice at >> rackspace is $11/mo. A week of Starbucks costs more than that. >> >> Jeff >> >> >> >> On Fri, Apr 16, 2010 at 9:28 PM, Timofey Koolin <[email protected]> wrote: >> > You can store your data in memcache and in datastore. Then you read >> > data from memcache or (if is'n exsists in memcache) from datasrore. Or >> > you can use write-behind cachehttp://www.youtube.com/watch?v=HL5igKTuN8M >> >> > On 17 апр, 08:04, Phuong Nguyen <[email protected]> wrote: >> >> Hi guys, >> >> I'm creating an online game server with GAE and there's a few concerns >> >> that I'd like to ask for advice. >> >> >> One of my problem is that I need to manage a lot of information that >> >> would not make sense to be stored in database. Like the status of each >> >> player, the last time server seen such player, his current position in >> >> the game. I'd like to store all of these information in the memory and >> >> periodically persist back to the data store. Problem is (correct me if >> >> I'm wrong) that GAE may shutdown my app and restart it on different >> >> server at any time, so, data in memory would be gone and I need to >> >> reload them from the database. But, certainly, if GAE Server restart >> >> my app before the periodical saving happens, then the status of >> >> players may be gone without my ability to recover back from database. >> >> And, these data are subject to high change, so, persist them to data >> >> store frequently would not be sensible. >> >> >> So, I may encounter problems to keep these data in memory. And I may >> >> also encounter performance problem to constantly persist these data to >> >> data store. So, would you guys please give me some advice? Am I >> >> missing some thing or there should be any technology/tricks that can >> >> be employed on GAE that can facilitate me to build such online game >> >> like this? >> >> >> Thanks. >> >> Phuong >> >> >> -- >> >> You received this message because you are subscribed to the Google Groups >> >> "Google App Engine for Java" 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 >> >> athttp://groups.google.com/group/google-appengine-java?hl=en. >> >> > -- >> > You received this message because you are subscribed to the Google Groups >> > "Google App Engine for Java" 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 >> > athttp://groups.google.com/group/google-appengine-java?hl=en. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google App Engine for Java" 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 >> athttp://groups.google.com/group/google-appengine-java?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine for Java" 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-java?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" 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-java?hl=en.
