Vra

I'm very very new to redis and still playing around with it. I want to test to see if its relevant to my project but I'm not sure about a specific command I'm running. The users on SO have got me convinced of the performance benefits of using pipelines and transactions so I thought I'd ask how to do this.

Basically I have two statements that I just want to issue and not have to wait for the result(seems like a good candidate for pipe lining. It looks like this:

Does valueX exist?
If it does insert valueY

Its pretty simple but so far all the ways I have been looking into it seem to wait for a response for if ValueX exists, and because I'm doing over a billion loops of my program it grinds it to a halt.

Is this possible? If it helps I'm using Java but haven't settled on which client library(jedis or jredis, still testing). I'm actually not even fully settled on redis but leaning very heavily towards it(seems good for what I'm doing speed wise), so any suggestions are acceptable.

Was dit nuttig?

Oplossing

No, it is not possible for the moment to accomplish such a thing. What you seek is a feature missing for the moment, but it will be available with the 2.6 version of Redis. It's called LUA scripting. You can execute server commands that are dependent of previous commands, all in one, without the need to fetch them at the client. For more details see here.

Gelisensieer onder: CC-BY-SA met toeskrywing
Nie verbonde aan StackOverflow
scroll top