Is there any theory that says that a cache should be faster than a file system?
I think that since the file system also uses caching there is no scientific proof that we should move content from file system to a cache such as memcache when the concept of file system is somewhat loose -- like downloading a "file" could be the same as downloading a memcached object.
My concrete example is whether to host a template engine via memcache or file system. Does it matter?
Your filesystem will probably be faster in many situations. E.g. when you need a cache for your "compiled templates", the filesystem will be faster.
And the filesystem caches (especially on linux) will make sure, that your cached templates - which are read often - are available in very short time. The kernel keeps them in an in-memory cache, and reads will be fast as hell.
memcached is a distributed key/value store. It has different use cases.
Please read the memcached about page to understand why memcached exists. Your question doesn't make sense unless you have a magical clustered filesystem cache for your 100 front-end web servers.
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