Data storage management is essential for preventing unnecessary resource usage, which affects not only performance but also battery life and overall end-user experience.
EVICT
API method to remove data from the local disk. You will need to set up an automatic process that evicts documents on a regular basis, such as once per day. Evict documents that are accessed less frequently or are no longer relevant in order to free up disk space.
EVICT
on a regular basis, but no more than once per day during periods of minimal disruption, such as after hours and at night.POST
request to the /api/v4/store/write
endpoint:
args
variable, declare your TTL.update
command.
“orders”
collection.
query
, define time‑based eviction criteria to select documents where the createdAt
time is less than or equal to $TTL
.
evictionFlag
in your query to true
.
evictionFlag
set to true
.evictionFlag
set to false
.subscription
method, execute the sync subscription on the documents that match your query criteria.Make sure to remove the timestamp range from your subscription query.This is because, by using the Big Peer for management, Small Peers no longer need to perform regular subscription updates to align their time-based eviction criteria in their queries.args
variable, declare your TTL."flights"
collection."createdAt"
field is greater than the ttl
.