apache / apache/kvrocks

INCR and DECR command with unsigned value

Open
#957 6 comments 0 reactions 1 assignee Claimed by @uds5501 View on GitHub
enhancement
Dominant language
C++
Stars
4.4k
Forks
658
Avg merge
1d 20h
Merged PRs (30d)
10

Description

### Search before asking

- [X] I had searched in the [issues](https://github.com/apache/incubator-kvrocks/issues) and found no similar issues.

### 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?

- [ ] I'm willing to submit a PR!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.