Skip to main content

without-durability-postgres

without-durability's two interfaces over one Postgres: three tables, and no mechanism of its own.

from psycopg_pool import AsyncConnectionPool
from without_durability_postgres import PostgresCheckpointer, PostgresDurable, PostgresScheduler, migrate

pool = AsyncConnectionPool(dsn, open=False)
await pool.open(wait=True)
await migrate(pool)
durable = PostgresDurable(PostgresCheckpointer(pool=pool), PostgresScheduler(pool=pool))

What is worth reading this package for is how little of it is mechanism. Every write the Redis store needs a Lua script for is one statement here, or one transaction, and neither is something this package supplies. Redis needs scripts because it has no way to say "check this, then write that, and let nobody in between"; SQL says it by default. The claim is an upsert whose DO UPDATE carries a WHERE on the lease; the fenced record is one statement whose FOR UPDATE CTE serializes it against a claim in flight; the queue takes with FOR UPDATE SKIP LOCKED, so several workers polling one table fan out instead of queueing on its head.

Three things that are live questions over Redis do not arise. A workflow id is a query parameter rather than key structure, so it carries no constraints at all. Nothing expires, so the TTL that can lose a suspended workflow is gone, and the fencing token can be an ordinary counter. And a default Postgres commits synchronously, so record returning means what the durable runner assumes it means.

SqlEffect is a callback handed a cursor inside the open transaction, so a step's own business write and its checkpoint commit together: exactly-once for that step, over the application's own tables. PostgresDurable extends that to the interface above, committing a value's arrival and the workflow's wakeup at once, which is what makes "you need no second system" a claim this can actually make. It is also where "one datastore" stops meaning "Postgres", since a transaction is local only on a single node.

See the without-durability-postgres guide (with the API reference) for the statements, the schema, what co-location a sharded deployment owes, and what a deployment still owes anyway (a sweep, and a real migration tool).

Metadata

Release files for without-durability-postgres 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for without-durability-postgres 0.0.3
File Size Uploaded
without_durability_postgres-0.0.3.tar.gz 14.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for without-durability-postgres 0.0.3
File Interpreter ABI Platform
without_durability_postgres-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 31.0 kB

Release files / without_durability_postgres-0.0.3.tar.gz

Download URL without_durability_postgres-0.0.3.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
79c992cfefb60fa3c686290102f1cdae3b0ee8579f6041f229c82ee4e645c530
BLAKE2b-256 checksum
How to use checksums
c7d3072a5ed56a1c80a7b34bcc5931dc83177aad489ab8ee8c025d3c013933a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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}

Release files / without_durability_postgres-0.0.3-py3-none-any.whl

Download URL without_durability_postgres-0.0.3-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36bf03d7722c98e13bd3d93fd3f9aa57530c055c2c35fa4279d4a940074b353b
BLAKE2b-256 checksum
How to use checksums
4c0a8bc132bceadf1de8d6066617aba45a88d21da38d3f8c560bd6aa72bb6d01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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}

Release history Release notifications | RSS feed

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page