Hi,
I am looking for a solution for below simple use case:
#1 Cache entries are created with expiry policy
#2 When restart ignite servers, we can restore the caches which haven't been expired.
As far as my knowledge, we need implement a persistent store and use cache with read/write through and life cycle bean.
There are several approaches:
#1 use MySQL server, if we use this solution:
a) for each cache, we need record TTL in a extra column.
b) we need schedule some jobs to delete expired data periodically to avoid disk full.
c) when load caches, we need read the TTL column and determine whether the cache is expired.
#2 Use Databases which already support TTL, for example rocksdb.
a) RocksDB is library. if we start a RocksDb instance in each ignite server node, thus the persisted data will
resides in each server's local file system. I don't know what's the behavior when there are multiple servers try to load caches.
also I don't know how to ensure the data is not lost and consistency when some node is down.
IMO,
#1 is a bit verbose.
#2 files based and auto TTL support is good, but need more codes and increase the complexity.
please comments.
Thanks
Shawn
