Compare and Swap added to Google App Engine Cloud

On Wednesday Google released v1.5.3 of their App Engine cloud platform SDK, the release notes are here. There are some interesting new additions to the API, however the one that really caught our eye is the addition of a Compare and Swap (CAS) primitive to their Memcache API.


A CAS primitive can be used to build all sorts of higher level synchronisation primitives like mutexes etc. and so the existence of such a primitive may be very handy for synchronisation of GAE taskqueue tasks! The SDK is currently quite lacking in such synchronisation tools so it will be interesting what can be done with this new addition.


Store Datastore Models in Google App Engine Cloud

Yesterday I came across this gem of a Blog post on Nick Johnson’s Blog about how to go about efficiently storing Google App Engine datastore objects in Memcache on the cloud.


I had previously read that the Datastore models were large and carried around a lot of baggage (software baggage that is, not the stuff on wheels!) – this is one reason why you are discouraged from passing them as arguments to tasks on task-queues.


This blog shows you how to extract and store only the essential info from the objects for storage in memcache using th methids model_to_protobuf () and model_from_protobuf()


Anyway, enough chat – here’s the post: