Code Monkey home page Code Monkey logo

Comments (9)

derekperkins avatar derekperkins commented on May 24, 2024

Do you get an error or other notification that the memcache lock failed?

from nds.

jongillham avatar jongillham commented on May 24, 2024

There isn't an error. It's just that there is a very tiny possibility that nds.Get will return stale results from its cache after using nds.RunInTransaction if the sequence of events occur exactly as described above.

It's makes the difference of the nds package having complete cache consistency compared to strong cache consistency.

from nds.

derekperkins avatar derekperkins commented on May 24, 2024

If there isn't any way to know whether or not memcache failed in the way you describe, you could force a cache reload at the end of every RunInTransaction request.

from nds.

jongillham avatar jongillham commented on May 24, 2024

That would help a bit, but if the cache reload failed we would still end up with a stale cache. I am beginning to think the package as it is now, although not perfect, is the best possible situation.

from nds.

derekperkins avatar derekperkins commented on May 24, 2024

I don't have any issues with the possibility of that cache error. It seems very unlikely, and as the datastore is eventually consistent anyways, people should already be ready for the possibility of stale data.

from nds.

jongillham avatar jongillham commented on May 24, 2024

The Get, Put and Delete datastore calls are strongly consistent. Only queries without an ancestor are eventually consistent. I rely on those guarantees for the type of code I write - which is why it is taking me so long to get this package right. 😅

from nds.

derekperkins avatar derekperkins commented on May 24, 2024

What about adding FlushCache(key) / FlushCacheAll() functions so that you can eliminate keys in the event that you absolutely can't have stale results?

from nds.

derekperkins avatar derekperkins commented on May 24, 2024

What about a GetIgnoreCache?

from nds.

jongillham avatar jongillham commented on May 24, 2024

With NDS the datastore never has the opportunity to be populated with stale results. It will always be 100% intact. So if you really need to return 100% non stale results you could just use datastore.Get perfectly fine which would be the equivalent of the GetIgnoreCache you suggested.

from nds.

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.