I’m developing an app to be hosted on GAE.Basically my app needs to connect people randomly.
I did similar app before where i assigned unique id to each user.Once the user enter the app his ID will be inserted into static synchronized LinkedHashSet(which acts like global datastore for app).Similarly second user enters synchronized LinkedHashSet,If he finds the ID other than his ID then they are connected.The Second user removes their ID’s from LinkedHashSet and Inserts them into Mysql DataBase as pairs.Note that access to LinkedHashSet is synchronized.
Now i wanted to design a similar app in cloud environment like GAE.But in GAE static variables are not global since the distributed nature of app engine.How to write similar code in cloud environment?
There are multiple approaches to this problem. You can very well use a combination of Channel API, DataStore API, Memcache API for providing a scalable real time chat room application.
Here is a good article on creating multiuser chatroom application – http://codecontrol.blogspot.com/2010/12/multiuser-chatroom-with-app-engine.html,
http://code.google.com/p/channel-tac-toe/
You will have to use datastore for storing the LinkedHashSet and further cache it in memcache for faster access.