As a cache product, ApsaraDB for Memcache allows users to set an expiration time for data storage based on their business needs. For example, you can set an expiration time when performing the add operation.
However, you may find that the data volume and record count for resource monitoring remain the same after setting an expiration time for ApsaraDB for Memcache. The data volume decreases around 2 a.m. (as shown in the following figure). This happens because that ApsaraDB for Memcache uses the lazy deletion mechanism.
This mechanism does not directly delete KV pairs from ApsaraDB for Memcache after data expiration. Instead, it marks them as inaccessible by applications and deletes expired KV pairs around 2:00 a.m. Therefore, you can see decreased data volume at that point of time, which however is a normal situation. This mechanism is designed to minimize the user impact of deleting the KV pairs.