codenotary / immudb

immudb - immutable database based on zero trust, SQL/Key-Value/Document model, tamperproof, data change history
https://immudb.io
Other
8.57k stars 344 forks source link

[FEATURE] - Implement Increment or Decrement API #842

Open sujit-baniya opened 3 years ago

sujit-baniya commented 3 years ago

What would you like to be added or enhanced Currently to increment or decrement, I've to fetch the value, increment value and set key for updated value.Because of this, there might be latency and atomicity between read and write is not obtained. So if there's two APIs: Increment and Decrement that would perform precise operation of increment or decrement. Why is this needed Currently I'm working with Redis and with simultaneous execution of incrByFloat from multiple places, the data READ vs data WRITE doesn't match. So I'm trying to implement immudb for this purpose. And I didn't find any documentation regarding Increment/Decrement so that I could test. Additional context

jeroiraz commented 3 years ago

thanks for reaching out @sujit-baniya

I think this topic deserves lot of thinking. Something was already discussed here #704

On one side, adding incrBy could be done without too much effort but it will be of limited functionality and a consistent set of operations may be needed.