memcached expiration time

前端 未结 8 1974
面向向阳花
面向向阳花 2020-12-29 08:46

Memcached provides a cache expiration time option, which specifies how long objects are retained in the cache. Assuming all writes are through the cache I f

8条回答
  •  甜味超标
    2020-12-29 09:32

    There are several reasons:

    1. Data storage is not persistent between server restarts. You will have to regenerate a large cache data after you restart or reload a caching server.
    2. There might be cases when you are not notified when an object has updated. eg. User details returned by APIs.
    3. Searching an object. SQL provides using same data to generate different results depending on requirements like recent and most-voted etc. You will have to use different cache keys to store the data for such different results (data duplication, a headache to update all relevant keys even if a single common datum changes). Also with Database Server you have greater flexibility on skimming through the data (custom stats, etc).

提交回复
热议问题