Cleanup and Conclusion
Last but not least, hosts that time out and matches that end abruptly will leave invalid data in the datastore. This data is ignored, but will accumulate over time. A java servlet was created to be used with GAE’s cron service. You can let GAE know how often to call the cleanup servlet by creating a cron.xml in your WEB-INF folder.
A few entries are also needed in your web.xml file.
Things to be considered
This was just an example of how to use GAE to create a scalable matchmaking service. For production, many things can be improved for your specific project. Error handling and a real authentication scheme would be necessary before using this service in the real world. This shouldn’t be very difficult to implement and Cloud Endpoints provides a nice means of OAuth authentication, if your platform supports it.
The full source code and test html files are available here.