hazelcast / hazelcast

Hazelcast is a unified real-time data platform combining stream processing with a fast data store, allowing customers to act instantly on data-in-motion for real-time insights.
https://www.hazelcast.com
Other
6.11k stars 1.83k forks source link

Refresh-Ahead behavior like Coherence #9861

Open bharathrajbk opened 7 years ago

bharathrajbk commented 7 years ago

Hi,

We are currently using the Enterprise Hazelcast in our solution and would like to cache all our customer data indefinitely (we have planned the required memory to support this).

However, in the event customer data changes in the data store, we'd like Hazelcast to have a feature like 'Refresh-Ahead' that Oracle Coherence supports: (link below) [https://docs.oracle.com/cd/E15357_01/coh.360/e15723/cache_rtwtwbra.htm#COHDG5177]

That does something like this -

In the Refresh-Ahead scenario, Coherence allows a developer to configure a cache to automatically and asynchronously reload (refresh) any recently accessed cache entry from the cache loader before its expiration.

More specifically,

The refresh-ahead time is expressed as a percentage of the entry's expiration time. For example, assume that the expiration time for entries in the cache is set to 60 seconds and the refresh-ahead factor is set to 0.5. If the cached object is accessed after 60 seconds, Coherence will perform a synchronous read from the cache store to refresh its value. However, if a request is performed for an entry that is more than 30 but less than 60 seconds old, the current value in the cache is returned and Coherence schedules an asynchronous reload from the cache store.

Does Hazelcast already have this feature? If not can we propose this as an enhancement?

Please advise. Thanks, Bharath Raj

enesakar commented 7 years ago

Not currently, but exists in product roadmap.