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).

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_postgres-0.0.2.tar.gz (14.7 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_postgres-0.0.2-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: without_durability_postgres-0.0.2.tar.gz
  • Upload date:
  • Size: 14.7 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_postgres-0.0.2.tar.gz
Algorithm Hash digest
SHA256 daf66420670568eea27f5c1b6dd8847da5f5fcf32fe6cdf07e4833f71a9c50be
MD5 2892b54125500c6cc3638133aa16507d
BLAKE2b-256 fef40eed9e4c0c0b4f39dc635b66aaf8354cfdc27a5359932165c751ca1cf49f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: without_durability_postgres-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 16.3 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_postgres-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5587eb952a24cee87893f3f26dc2e4a93a6c52da7eb48cfd8925fffee1273f7e
MD5 617cc000601d3e243a6654a5b56505c8
BLAKE2b-256 95625e042df7e22020fb744c2a1b397634296ba2958d525b139677add2db8e4f

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