Does the java version use memcache for Ranker entities?

45 views
Skip to first unread message

Sabih Egbaria

unread,
Aug 2, 2015, 11:02:58 AM8/2/15
to Google App Engine Ranklist
I suppose every time a score is submitted, the root entity is fetched, then child nodes are fetched, are those cached using memcache ?
I'm using the Java version.

Bartholomew Furrow

unread,
Aug 2, 2015, 5:46:42 PM8/2/15
to Google App Engine Ranklist
I haven't worked with the Java version or with Java App Engine, so I don't know if there's some automatic memcaching happening. One thing you can do to find out is enable appstats, and see if any memcache calls happen.

I'll tell you, though, that if there are memcache calls going on, you should try to stop them. As the library is written right now, you really don't want them.

On Sun, Aug 2, 2015 at 9:03 AM Sabih Egbaria <sabi...@gmail.com> wrote:
I suppose every time a score is submitted, the root entity is fetched, then child nodes are fetched, are those cached using memcache ?
I'm using the Java version.

--
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.

Sabih Egbaria

unread,
Aug 3, 2015, 2:33:20 AM8/3/15
to Google App Engine Ranklist
Hi thank for the library and your support, I checked and there was no use of memcache.
I've already added cache support. why I don't need them ? will something break or they'll just be unnecessary ?

every node fetched using datastore.get would be fetched from the cache.

Bartholomew Furrow

unread,
Aug 3, 2015, 4:48:59 PM8/3/15
to google-app-en...@googlegroups.com
The problem is that memcache is missing all four components of ACIDDepending on your implementation, if you're relying on memcache you will likely have some of the following problems:

  • Atomicity: If you have to update six ranker nodes, you might end up only updating three of them in memcache (e.g. if your app server crashes mid-update), and thus end up in a nonsensical or incorrect state.
  • Consistency: Your final state isn't guaranteed to be sensible.
  • Isolation: Two machines concurrently updating the ranklist might end up putting inconsistent results in memcache. e.g. machine A and B read nodes X and Y; then machine A updates node X, then machine B updates node X, then machine B updates node Y, then machine A updates node Y. Now X is in the state B thinks it should be in, and Y is in the state A thinks it should be in.
  • Durability: Memcache doesn't persist. If it's backed by datastore, that might not be a problem.
I hope that helps!
Bartholomew

--
Reply all
Reply to author
Forward
0 new messages