Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.
Where we can use memchaced in application?
If you have a high-traffic site that is dynamically generated with a high database load that contains mostly read threads then memcached can help lighten the load on your database. If your DB load is low but CPU usage very high, you could cache computed objects and renderred templates. You can reduce writes related to session handling, temporarily stash data, cache small but frequently accessed files, cache results from web "services" or RSS feeds...
What's the limitation of memcached?
- Objects larger than 1MB. Memcached is not for large media and streaming huge blobs.
- The maximum size of a key is 250 characters The maximum size of a value you can store in memcached is 1 megabyte. If your data is larger, consider clientside compression or splitting the value up into multiple keys.
- Anyone can just telnet to any memcached server. If you're on a shared system. Do not run in DMZ zone.
- No persistence
- Memcached doesn't support fail over. Remove dead nodes from your list. Be very careful! With default clients adding or removing servers will invalidate all of your cache! Since the list of servers to hash against has changed, most of your keys will likely hash to different servers. It's like restarting all of your nodes at the same time

No comments:
Post a Comment