0

It's a question about GAE behind the scene.

ok, it can be a silly question, but I want figure out how google can support geographic distributed datacenters and what strategies used in memcached in this case.

In a logic view perspective, it a "one" (and consistent) memcached server by app? Let me explain: one of most knowed cases to use memcached is a "Page View Count" sample. Well, if memcached is distributed/replicated (that is, the key:value will be distributed and replicated in n+1 machines) I can't guarantee a consistent value (or something like this), because the count value will be divide by n+1.

Another case that a distributed/replicated memcached can result in troubles: I would use some not updated entity value. ex: step 1. req webserver1+memcached1 (do some queries and cache entity1 in memcached1) step 2. req webserver2+memcached2 (update entity1 and invalidate it in memcached2) step 3. req webserver1+memcached1 (get entity1 from memcached1, but it's a old data, because it was updated in datastore, invalidated in memcached2 but NOT in memcached1!!)

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Fulvius
  • 511
  • 6
  • 15

1 Answers1

1

A single memcache is shared across all instances of your application.

It does not matter what instance puts a value in or gets it out, they all share the same storage.

So yes, it's by app.

Paul Collingwood
  • 9,053
  • 3
  • 23
  • 36
  • 1
    Even if it's geo distributed app? (ex.: EU and USA) – Fulvius Jan 14 '13 at 12:04
  • 1
    An app can only be in one or the other data centre locations, not both. You choose. So it simply does not come up - there is no need to sync memcache. https://developers.google.com/appengine/docs/premier/location. – Paul Collingwood Jan 14 '13 at 12:10