1
votes

The API of memcache for google app engine allows one to specify a namespace argument. For example:

add(key, value, time=0, min_compress_len=0, namespace=None)

Does providing a namespace argument improve performance, i.e., does memcache use the namespace for partitioning the cache keys?

The reason I ask is that my cache keys currently have a "prefix", and I am considering moving that "prefix" out from the keys into the 'namespace' argument.

1

1 Answers

2
votes

Namespaces are an organizational feature. They're primarily useful for multitenancy (per-user data segratation). Using them might have some performance effect, but I seriously doubt you'd be able to measure that effect.

If you're not currently using multitenancy, make sure you read https://cloud.google.com/appengine/docs/python/multitenancy/multitenancy before using namespaces for cache key prefixes, so that you don't cause yourself problems if you later need to add multitenancy.