Skip to main content

without-durability-redis

without-durability's two interfaces over Redis: a workflow's completed steps as one hash, its claim as another, and a queue of workflows that can run now.

from redis.asyncio import Redis
from without_durability import SplitDurable
from without_durability_redis import RedisCheckpointer, RedisStreamScheduler

redis = Redis(host=..., decode_responses=True)   # this client owns both ends of every key
durable = SplitDurable(RedisCheckpointer(redis=redis), RedisStreamScheduler(redis=redis))

Every guarantee here is a small Lua script, and each is a script for the same reason: it is only correct as one step. Checking whether a workflow is free and taking it; checking a fencing token and applying the write it guards; testing whether a key is recorded and reading back the winner. Split any of them into two round trips and the gap between them is where the guarantee leaks.

LuaEffect is what this store can commit alongside a record, so a step whose effect is a Redis write happens exactly once. That is worth stating plainly, because the usual framing (that exactly-once needs Postgres) is wrong about why: a Lua script is an atomic commit over Redis data, and the real constraint is that you can only transact within one datastore.

On a cluster that constraint becomes a slot. A workflow's two keys are hash-tagged (workflow:{id}) so a script may touch both, and an effect's keys must carry the same tag. Redis enforces this rather than trusting it: declared keys spanning slots are refused outright, and a script reaching a key another node owns dies partway having written nothing.

Two queues ship, and the difference between them is the finding rather than a choice you have to make carefully. RedisStreamScheduler is a stream read as a consumer group beside a deadline-scored sorted set, which buys a blocking read so an idle worker costs nothing. RedisSetScheduler is one sorted set scored by when each workflow becomes visible, which makes the timer, the consumer group, the pending list, and the trimmer all disappear, and costs the blocking read.

See the without-durability-redis guide (with the API reference) for the scripts themselves, what each key holds and for how long, and the two sharp edges (Redis's default persistence, and a TTL that can outlive a suspended workflow).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

without_durability_redis-0.0.2.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

without_durability_redis-0.0.2-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file without_durability_redis-0.0.2.tar.gz.

File metadata

  • Download URL: without_durability_redis-0.0.2.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for without_durability_redis-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c6a10f0fe4bbf9955eb9473b9c6e45410a3436135683dc62769e99532234f305
MD5 887593384a988d07a452191ab84f0fe9
BLAKE2b-256 8faedec263f4f8352341f147d382ae2d1e3121f4f11a81eb644f934b8c334773

See more details on using hashes here.

File details

Details for the file without_durability_redis-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: without_durability_redis-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for without_durability_redis-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 383711743d10a33744c7bbe782a7e95c30b92614153a9ba91421dace81d3eb20
MD5 d005ec6fdddb5d9b353173cb8b77662b
BLAKE2b-256 9ea3eaf029be422740418fa1b1fd37dd0f4a9562aa95efbe402967cd178f7cf5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page