NDB version of Ranklist

49 views
Skip to first unread message

Clint Doriot

unread,
Apr 26, 2015, 5:26:56 PM4/26/15
to google-app-en...@googlegroups.com
Has anyone used this ndb port of Ranklist?

I've only started to begin implementing ranklist for my project, and am wondering if I should use this version, as my project uses ndb for everything else.

I would think that the biggest pro for using this library is taking advantage of ndb's automatic memcaching of entities (unless its explicitly disabled). But that could potentially backfire if you have too many nodes and not enough memcache space. Ideally it would be nice to control the a depth level of which nodes are cached, since the top nodes are going to be more frequently accessed. (I think... again, I'm very new to using ranklist).

Thoughts?

-Clint

Bartholomew Furrow

unread,
Apr 26, 2015, 5:40:40 PM4/26/15
to google-app-en...@googlegroups.com
Hi Clint,

That looks very interesting. This is actually the first I've heard of the NDB version. I don't have experience with using NDB at scale, but I'll say that the caching stuff makes me feel pretty nervous if you are going to have lots of simultaneous modifications happening to the ranklist. I don't know how clever NDB attempts to be, but it's simply impossible to prevent the possibility of memcache "corruption" (having something other than current datastore version of an Entity in memcache) without the transactional semantics that memcache lacks. With more simultaneous use of the same Entities, the probability increases. But I don't know how to figure out how likely it is.

On the other hand, you can disable the NDB caching and (assuming the library is well-written) you should be just fine. See https://cloud.google.com/appengine/docs/python/ndb/contextclass for how to do that, I think. (It should be as simple as setting the class's _use_memcache to lambda x:False).

Bartholomew

--
You received this message because you are subscribed to the Google Groups "Google App Engine Ranklist" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-app-engine-r...@googlegroups.com.
To post to this group, send email to google-app-en...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-app-engine-ranklist.
For more options, visit https://groups.google.com/d/optout.

Clint Doriot

unread,
Apr 27, 2015, 4:34:42 PM4/27/15
to google-app-en...@googlegroups.com
Just a follow up to this thread if anyone is coming here after the fact...

Bartholomew and I talked offline and decided this library probably wasn't a good solution yet, for two reasons: (1) ndb uses memcache, and as far as I can tell from my (admittedly quick glance) understanding of this library, they dont turn memcache off. Because memcache can't operate in a transactional way, this could cause undefined and erroneous behavior within the library. (2) this library turns off transactions for reads, which again, seems likely to result in undefined or erroneous behavior.

If anyone has actual experience using this version of the library in production, please feel free to weigh in.
Reply all
Reply to author
Forward
0 new messages