-
Notifications
You must be signed in to change notification settings - Fork 472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
INCR and DECR command with unsigned value #957
Comments
Will pick this up |
@uds5501 Assigned. Thank you! |
@aleksraiden @torwig I have a bit of doubt about this improvement. If the 63-bit is not enough for recording id, then the 64-bit should be also helpless. It makes sense to extend the 64-bit integer to 128-bit, but not from 63 to 64 from my perspective. |
As I think, no. So, this is a two different points:
|
@aleksraiden @git-hulk I am a bit lost here, what kind of behaviour is expected? Why shouldn't we be able to both INCR and DECR a key? Why have a monotonic function? |
@aleksraiden @uds5501 I don't think we should offer this ability in a generalized database and should control this on the user's side.
That's right, my doubt is why 64-bit can help compared to 63-bit. My opinion is 64-bit shouldn't help if 63-bit is not enough for your scenario. |
Search before asking
Motivation
Traditionally, KVrocks like Redis, use signed Int64/Float64 for counter commands (INCR/DECR and HINCR/HDECR). But in extra case, we need more data, a full 64 bit number (unsigned).
Solution
Could we add a command-flag to create only signed value for this commands.
A little bit more, maybe a good idea to add other flag for increment/decrement ONLY.
Why? In my case, we use HSET with incremented fields as a central repository for global counters. like tradeId. So, we need always monotonic counter, without possibility of modify element in decrement.
And we need real Int64 unsigned value, because in hi-load HFT-system and hundred of assets, this counter must be presents over all period (need for regulatory requirements, an least 5 years all data must be stored and availability)
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: