Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GAE: memcache: is it the same across multiple app instances

I have a pretty basic question: In GAE, if I use memcache to store some data once it was retrieved for the first time from the db, if then that data remains in the cache for like 2 days, do ALL instances of said application get to "see" it and retrieve it from cache? Or is the cache separate for each application instance?

I'm asking this because I've seen that due to the way that GAE spawns separate VM processes (not threads) for each new instance an application needs, stuff that used to be consistent across all instances (in the thread model) is now fragmented per instance (process): like the servelet application context which is NOT propagated across all instances of the same application.

So, again, is memcache consisten across multiple instances of the same application, or does it create per instance/process sets of cached data?

like image 989
Shivan Dragon Avatar asked Nov 08 '11 18:11

Shivan Dragon


People also ask

Does Memcached have replication?

Redis instances can also have more than one replica for added redundancy. Memcached does not support replication without third party software.

Why Redis is better than memcache?

Although they are both easy to use and offer high performance, there are important differences to consider when choosing an engine. Memcached is designed for simplicity while Redis offers a rich set of features that make it effective for a wide range of use cases.

What happens when memcache is full?

First, when memcached gets full, it will start removing items from the cache using the Least Recently Used algorithm. Second, you can have multiple instances of memcached running, adding them gets complicated because it will change the hashing algorithm used to determine which cache the data is in.

How is memcache used in cloud computing?

It is often used to speed up dynamic database-driven websites by caching data and objects in RAM to reduce the number of times an external data source (such as a database or API) must be read.


1 Answers

It's consistent; GAE memcache runs as a service separate from your instances.

like image 51
Peter S Magnusson Avatar answered Sep 22 '22 01:09

Peter S Magnusson