[google-appengine] Re: Memcache: Should we save Model instance or protocol buffer?

2010-02-05 Thread Andy Freeman
I'm pretty sure that the protocol buffer saves just the key. However, I'm virtually certain that pickle will save both the instance and the key if an reference property has been used. And, if that instance has used reference properties, their instances are also saved by pickle. I mention pickle

[google-appengine] Re: Memcache: Should we save Model instance or protocol buffer?

2010-02-04 Thread Sylvain
I think the answer (and more) is here : http://blog.notdot.net/2009/9/Efficient-model-memcaching On Feb 4, 10:43 am, Nickolas Daskalou n...@daskalou.com wrote: Is it better/safer to store a Model instance into Memcache directly (Method 1 below), or should we convert it to a protocol buffer

Re: [google-appengine] Re: Memcache: Should we save Model instance or protocol buffer?

2010-02-04 Thread Nickolas Daskalou
Perfect, thanks Sylvain. :) Nick On 5 February 2010 03:11, Sylvain sylvain.viv...@gmail.com wrote: I think the answer (and more) is here : http://blog.notdot.net/2009/9/Efficient-model-memcaching On Feb 4, 10:43 am, Nickolas Daskalou n...@daskalou.com wrote: Is it better/safer to store a

[google-appengine] Re: Memcache: Should we save Model instance or protocol buffer?

2010-02-04 Thread Andy Freeman
Note that memcaching a protocol buffer has interesting consequences. One is that the auto-now datetime properties are updated when the protocol buffer is created. This update is just on the protocol buffer - it doesn't affect the datastore copy.

Re: [google-appengine] Re: Memcache: Should we save Model instance or protocol buffer?

2010-02-04 Thread Nickolas Daskalou
Thanks Andy. Do you know what happens to a RefenceProperty that has already had the referenced entity loaded on the Model instance? Does the referenced entity also get saved in the ProtocolBuffer, or is only its key saved? On 5 February 2010 16:54, Andy Freeman ana...@earthlink.net wrote: Note