GithubHelp home page GithubHelp logo

Support TTL and reloadData about ristretto HOT 15 CLOSED

tuanpavn avatar tuanpavn commented on April 27, 2024 25
Support TTL and reloadData

from ristretto.

Comments (15)

barkanido avatar barkanido commented on April 27, 2024 15

Ttl eviction is highly valuable!

from ristretto.

manishrjain avatar manishrjain commented on April 27, 2024 11

We can do TTL based expiry. But load on TTL seems like a cumbersome design.

from ristretto.

karlmcguire avatar karlmcguire commented on April 27, 2024 8

Will be working on this over the next few days.

from ristretto.

songboyu avatar songboyu commented on April 27, 2024 7

hello, could I ask when would you plan to add the ttl feature? I think it is necessary

from ristretto.

martinmr avatar martinmr commented on April 27, 2024 2

@barkanido This was just merged recently. See PR #122

from ristretto.

barkanido avatar barkanido commented on April 27, 2024 1

@karlmcguire any update on this?

from ristretto.

barkanido avatar barkanido commented on April 27, 2024

Agreed, just invalidate items due to TTL and let the client decide.

from ristretto.

MarcSky avatar MarcSky commented on April 27, 2024

Yes we need ttl

from ristretto.

MarcSky avatar MarcSky commented on April 27, 2024

For example, I want than 1 key living 10second and after reload

from ristretto.

caofengl avatar caofengl commented on April 27, 2024

Will be working on this over the next few days.
May I ask when the master can join the ttl function?

from ristretto.

momilo avatar momilo commented on April 27, 2024

If I may join the discussion... It might be worth considering adding automated purging of expired items.

Ristretto currently seems to be focusing on a scenario where there is a huge amount of data, only a portion of which can be stored in pre-defined size of cache, and it is stored forever (i.e. MaxCost is reached quickly; some additional keys are tracked - NumCounters).

However, many use-cases require a TTL-driven cache, whereby you have to / are happy to cache everything as long as ... e.g. it is max 5 minutes old (e.g. for operations which tend to always be resolved within 1-2 minutes). Hence you would expect the MaxCost to be large (just in case ever needed) but the average cache size would be minimal. A go routine checking expiry times and deleting entries would be needed - and highly appreciated.

I would be happy to help with coding this. Currently it seems like karlmcguire and caofengl are already on it, but feel free to reach out to me if some extra help is needed.

from ristretto.

barkanido avatar barkanido commented on April 27, 2024

I think this was the original intent. wasn't it?

from ristretto.

momilo avatar momilo commented on April 27, 2024

My understanding was that the original intention was to merely add TTL as an eviction criterion, i.e. to remove expired items only when, and only to the extent that a space needs to be made for, a new item. But if a routine cleanup is already being considered then great.

from ristretto.

martinmr avatar martinmr commented on April 27, 2024

Re-opening since only the TTL part is done. I am not sure what the status of the reload function is.

from ristretto.

martinmr avatar martinmr commented on April 27, 2024

Just noticed that Manish didn't agree with the need of a reload function. I think it's a bad idea too. If you need to reload an item immediately after it's expired the client should handle it.

from ristretto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.