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?
Redis instances can also have more than one replica for added redundancy. Memcached does not support replication without third party software.
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.
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.
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.
It's consistent; GAE memcache runs as a service separate from your instances.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With