Giter Site home page Giter Site logo

SETNX is not implemented about garnet HOT 7 OPEN

yeurch avatar yeurch commented on May 29, 2024
SETNX is not implemented

from garnet.

Comments (7)

mgravell avatar mgravell commented on May 29, 2024 3

from garnet.

TalZaccai avatar TalZaccai commented on May 29, 2024

Hi @yeurch! Thanks for bringing that to our attention. That's a mistake in the API Compatibility page, I'll have it updated.

In any case, SETNX is now considered deprecated by Redis (https://redis.io/docs/latest/commands/setnx/), and can be replaced with running SET with the NX argument, so I don't believe we'll be implementing that one, unless there's a specific need.

If you're using SERedis, you can run (string)db.Execute($"SET", key, value, "NX") instead

from garnet.

yeurch avatar yeurch commented on May 29, 2024

Thanks for digging into this @TalZaccai. I hadn't realized that the command was deprecated, sorry. I guess this could be a philosophical debate ... does Garnet intend to be fully compatible with Redis? If so, I'd argue these should be implemented, otherwise it's not 100% compatible. But they've been marked as deprecated for so long by Redis that I guess it's a tough call.

Another interesting point is that StackExchange.Redis, which you mention in your very first bullet point in the README, appears to use SETNX key val rather than SET key val NX. If this client is widely in use, then I think it could cause issues for many users. db.SetString() seems to be the "normal" way to do sets from SERedis, and having to switch to the lower level db.Execute("SET", ...) could cause confusion.

from garnet.

badrishc avatar badrishc commented on May 29, 2024

@mgravell - do you know under what condition db.StringSet("my_key", "value1", null, When.NotExists) in SE.Redis would use the deprecated SETNX versus what Garnet supports, SET .. NX?

from garnet.

mgravell avatar mgravell commented on May 29, 2024

from garnet.

badrishc avatar badrishc commented on May 29, 2024

This makes sense, thanks!

from garnet.

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.