PipedreamHQ / PipedreamHQ/pipedream

[FEATURE] Atomic increment key for Pipedream Data Store

Open
#9,980 0 comments 2 reactions 0 assignees View on GitHub
enhancement tracked internally triaged
Dominant language
JavaScript
Stars
11.7k
Forks
5.8k
Avg merge
3d 10h
Merged PRs (30d)
102

Description

**Is your feature request related to a problem? Please describe.**
Most data store operations do not support concurrency, because reading a value, then modifying it, and then writing it back can easily lead to race conditions across parallel workflows.

- Atomic: 1 --> `incr` --> `incr` = 3
- Non-atomic/race condition: 1 --> two workflows read 1 at the same time, increment it, and write it back = 2

**Describe the solution you'd like**
The ability to increment (or decrement) a numeric value in the Data Store. The resulting value should be returned.

**Do you have a workaround?**
Workarounds are possible, but painful & complex.

**Comparable features in other tools?**
[Redis' `incr`/`incrby` operation](https://redis.io/commands/incrby/) is reliably atomic, even under extremely high concurrency.

![image](https://github.com/PipedreamHQ/pipedream/assets/66686238/f32d48f3-805e-41b3-8499-d10532bc2967)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.