跳转到主要内容

ulak

Transactional Outbox extension for PostgreSQL with reliable asynchronous delivery

ulak : Transactional Outbox extension for PostgreSQL with reliable asynchronous delivery

Overview

ID Extension Package Version Category License Language
2680 ulak ulak 0.2.0 FEAT Apache-2.0 C
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--sLd-- No Yes Yes Yes no no
Relationships
Schemas ulak
See Also pgmq pgmb pg_durable redis pgq pgmqtt pg_task tcn pg_background fsm_core
preload required; rm README from RPM/DEB

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT PIGSTY 0.2.0 18 17 16 15 14 ulak -
RPM PIGSTY 0.2.0 18 17 16 15 14 ulak_$v -
DEB PIGSTY 0.2.0 18 17 16 15 14 postgresql-$v-ulak -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0
el8.aarch64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0
el9.x86_64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0
el9.aarch64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0
el10.x86_64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0
el10.aarch64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0
d12.x86_64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0
d12.aarch64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0
d13.x86_64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0
d13.aarch64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0
u22.x86_64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0
u22.aarch64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0
u24.x86_64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0
u24.aarch64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0
u26.x86_64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0
u26.aarch64 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0 PIGSTY 0.2.0
Package Version OS ORG SIZE File URL
ulak_18 0.2.0 el8.x86_64 pigsty 308.7 KiB ulak_18-0.2.0-1PGSTY.el8.x86_64.rpm
ulak_18 0.2.0 el8.aarch64 pigsty 303.1 KiB ulak_18-0.2.0-1PGSTY.el8.aarch64.rpm
ulak_18 0.2.0 el9.x86_64 pigsty 336.6 KiB ulak_18-0.2.0-1PGSTY.el9.x86_64.rpm
ulak_18 0.2.0 el9.aarch64 pigsty 332.5 KiB ulak_18-0.2.0-1PGSTY.el9.aarch64.rpm
ulak_18 0.2.0 el10.x86_64 pigsty 337.3 KiB ulak_18-0.2.0-1PGSTY.el10.x86_64.rpm
ulak_18 0.2.0 el10.aarch64 pigsty 333.3 KiB ulak_18-0.2.0-1PGSTY.el10.aarch64.rpm
postgresql-18-ulak 0.2.0 d12.x86_64 pigsty 285.6 KiB postgresql-18-ulak_0.2.0-1PGSTY~bookworm_amd64.deb
postgresql-18-ulak 0.2.0 d12.aarch64 pigsty 279.0 KiB postgresql-18-ulak_0.2.0-1PGSTY~bookworm_arm64.deb
postgresql-18-ulak 0.2.0 d13.x86_64 pigsty 314.1 KiB postgresql-18-ulak_0.2.0-1PGSTY~trixie_amd64.deb
postgresql-18-ulak 0.2.0 d13.aarch64 pigsty 306.5 KiB postgresql-18-ulak_0.2.0-1PGSTY~trixie_arm64.deb
postgresql-18-ulak 0.2.0 u22.x86_64 pigsty 300.3 KiB postgresql-18-ulak_0.2.0-1PGSTY~jammy_amd64.deb
postgresql-18-ulak 0.2.0 u22.aarch64 pigsty 295.6 KiB postgresql-18-ulak_0.2.0-1PGSTY~jammy_arm64.deb
postgresql-18-ulak 0.2.0 u24.x86_64 pigsty 320.8 KiB postgresql-18-ulak_0.2.0-1PGSTY~noble_amd64.deb
postgresql-18-ulak 0.2.0 u24.aarch64 pigsty 317.5 KiB postgresql-18-ulak_0.2.0-1PGSTY~noble_arm64.deb
postgresql-18-ulak 0.2.0 u26.x86_64 pigsty 320.0 KiB postgresql-18-ulak_0.2.0-1PGSTY~resolute_amd64.deb
postgresql-18-ulak 0.2.0 u26.aarch64 pigsty 315.3 KiB postgresql-18-ulak_0.2.0-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
ulak_17 0.2.0 el8.x86_64 pigsty 308.5 KiB ulak_17-0.2.0-1PGSTY.el8.x86_64.rpm
ulak_17 0.2.0 el8.aarch64 pigsty 303.1 KiB ulak_17-0.2.0-1PGSTY.el8.aarch64.rpm
ulak_17 0.2.0 el9.x86_64 pigsty 336.4 KiB ulak_17-0.2.0-1PGSTY.el9.x86_64.rpm
ulak_17 0.2.0 el9.aarch64 pigsty 332.4 KiB ulak_17-0.2.0-1PGSTY.el9.aarch64.rpm
ulak_17 0.2.0 el10.x86_64 pigsty 337.2 KiB ulak_17-0.2.0-1PGSTY.el10.x86_64.rpm
ulak_17 0.2.0 el10.aarch64 pigsty 333.5 KiB ulak_17-0.2.0-1PGSTY.el10.aarch64.rpm
postgresql-17-ulak 0.2.0 d12.x86_64 pigsty 285.4 KiB postgresql-17-ulak_0.2.0-1PGSTY~bookworm_amd64.deb
postgresql-17-ulak 0.2.0 d12.aarch64 pigsty 278.9 KiB postgresql-17-ulak_0.2.0-1PGSTY~bookworm_arm64.deb
postgresql-17-ulak 0.2.0 d13.x86_64 pigsty 314.0 KiB postgresql-17-ulak_0.2.0-1PGSTY~trixie_amd64.deb
postgresql-17-ulak 0.2.0 d13.aarch64 pigsty 306.7 KiB postgresql-17-ulak_0.2.0-1PGSTY~trixie_arm64.deb
postgresql-17-ulak 0.2.0 u22.x86_64 pigsty 326.1 KiB postgresql-17-ulak_0.2.0-1PGSTY~jammy_amd64.deb
postgresql-17-ulak 0.2.0 u22.aarch64 pigsty 321.7 KiB postgresql-17-ulak_0.2.0-1PGSTY~jammy_arm64.deb
postgresql-17-ulak 0.2.0 u24.x86_64 pigsty 320.8 KiB postgresql-17-ulak_0.2.0-1PGSTY~noble_amd64.deb
postgresql-17-ulak 0.2.0 u24.aarch64 pigsty 317.4 KiB postgresql-17-ulak_0.2.0-1PGSTY~noble_arm64.deb
postgresql-17-ulak 0.2.0 u26.x86_64 pigsty 320.0 KiB postgresql-17-ulak_0.2.0-1PGSTY~resolute_amd64.deb
postgresql-17-ulak 0.2.0 u26.aarch64 pigsty 315.3 KiB postgresql-17-ulak_0.2.0-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
ulak_16 0.2.0 el8.x86_64 pigsty 308.6 KiB ulak_16-0.2.0-1PGSTY.el8.x86_64.rpm
ulak_16 0.2.0 el8.aarch64 pigsty 302.9 KiB ulak_16-0.2.0-1PGSTY.el8.aarch64.rpm
ulak_16 0.2.0 el9.x86_64 pigsty 336.5 KiB ulak_16-0.2.0-1PGSTY.el9.x86_64.rpm
ulak_16 0.2.0 el9.aarch64 pigsty 332.5 KiB ulak_16-0.2.0-1PGSTY.el9.aarch64.rpm
ulak_16 0.2.0 el10.x86_64 pigsty 337.2 KiB ulak_16-0.2.0-1PGSTY.el10.x86_64.rpm
ulak_16 0.2.0 el10.aarch64 pigsty 333.3 KiB ulak_16-0.2.0-1PGSTY.el10.aarch64.rpm
postgresql-16-ulak 0.2.0 d12.x86_64 pigsty 285.2 KiB postgresql-16-ulak_0.2.0-1PGSTY~bookworm_amd64.deb
postgresql-16-ulak 0.2.0 d12.aarch64 pigsty 278.9 KiB postgresql-16-ulak_0.2.0-1PGSTY~bookworm_arm64.deb
postgresql-16-ulak 0.2.0 d13.x86_64 pigsty 313.9 KiB postgresql-16-ulak_0.2.0-1PGSTY~trixie_amd64.deb
postgresql-16-ulak 0.2.0 d13.aarch64 pigsty 306.6 KiB postgresql-16-ulak_0.2.0-1PGSTY~trixie_arm64.deb
postgresql-16-ulak 0.2.0 u22.x86_64 pigsty 325.5 KiB postgresql-16-ulak_0.2.0-1PGSTY~jammy_amd64.deb
postgresql-16-ulak 0.2.0 u22.aarch64 pigsty 321.1 KiB postgresql-16-ulak_0.2.0-1PGSTY~jammy_arm64.deb
postgresql-16-ulak 0.2.0 u24.x86_64 pigsty 320.7 KiB postgresql-16-ulak_0.2.0-1PGSTY~noble_amd64.deb
postgresql-16-ulak 0.2.0 u24.aarch64 pigsty 317.3 KiB postgresql-16-ulak_0.2.0-1PGSTY~noble_arm64.deb
postgresql-16-ulak 0.2.0 u26.x86_64 pigsty 320.1 KiB postgresql-16-ulak_0.2.0-1PGSTY~resolute_amd64.deb
postgresql-16-ulak 0.2.0 u26.aarch64 pigsty 315.4 KiB postgresql-16-ulak_0.2.0-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
ulak_15 0.2.0 el8.x86_64 pigsty 310.7 KiB ulak_15-0.2.0-1PGSTY.el8.x86_64.rpm
ulak_15 0.2.0 el8.aarch64 pigsty 304.6 KiB ulak_15-0.2.0-1PGSTY.el8.aarch64.rpm
ulak_15 0.2.0 el9.x86_64 pigsty 343.4 KiB ulak_15-0.2.0-1PGSTY.el9.x86_64.rpm
ulak_15 0.2.0 el9.aarch64 pigsty 340.0 KiB ulak_15-0.2.0-1PGSTY.el9.aarch64.rpm
ulak_15 0.2.0 el10.x86_64 pigsty 344.5 KiB ulak_15-0.2.0-1PGSTY.el10.x86_64.rpm
ulak_15 0.2.0 el10.aarch64 pigsty 340.7 KiB ulak_15-0.2.0-1PGSTY.el10.aarch64.rpm
postgresql-15-ulak 0.2.0 d12.x86_64 pigsty 288.8 KiB postgresql-15-ulak_0.2.0-1PGSTY~bookworm_amd64.deb
postgresql-15-ulak 0.2.0 d12.aarch64 pigsty 282.3 KiB postgresql-15-ulak_0.2.0-1PGSTY~bookworm_arm64.deb
postgresql-15-ulak 0.2.0 d13.x86_64 pigsty 318.2 KiB postgresql-15-ulak_0.2.0-1PGSTY~trixie_amd64.deb
postgresql-15-ulak 0.2.0 d13.aarch64 pigsty 310.0 KiB postgresql-15-ulak_0.2.0-1PGSTY~trixie_arm64.deb
postgresql-15-ulak 0.2.0 u22.x86_64 pigsty 331.9 KiB postgresql-15-ulak_0.2.0-1PGSTY~jammy_amd64.deb
postgresql-15-ulak 0.2.0 u22.aarch64 pigsty 328.6 KiB postgresql-15-ulak_0.2.0-1PGSTY~jammy_arm64.deb
postgresql-15-ulak 0.2.0 u24.x86_64 pigsty 328.1 KiB postgresql-15-ulak_0.2.0-1PGSTY~noble_amd64.deb
postgresql-15-ulak 0.2.0 u24.aarch64 pigsty 325.2 KiB postgresql-15-ulak_0.2.0-1PGSTY~noble_arm64.deb
postgresql-15-ulak 0.2.0 u26.x86_64 pigsty 327.9 KiB postgresql-15-ulak_0.2.0-1PGSTY~resolute_amd64.deb
postgresql-15-ulak 0.2.0 u26.aarch64 pigsty 323.3 KiB postgresql-15-ulak_0.2.0-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
ulak_14 0.2.0 el8.x86_64 pigsty 310.5 KiB ulak_14-0.2.0-1PGSTY.el8.x86_64.rpm
ulak_14 0.2.0 el8.aarch64 pigsty 304.4 KiB ulak_14-0.2.0-1PGSTY.el8.aarch64.rpm
ulak_14 0.2.0 el9.x86_64 pigsty 343.3 KiB ulak_14-0.2.0-1PGSTY.el9.x86_64.rpm
ulak_14 0.2.0 el9.aarch64 pigsty 339.7 KiB ulak_14-0.2.0-1PGSTY.el9.aarch64.rpm
ulak_14 0.2.0 el10.x86_64 pigsty 344.6 KiB ulak_14-0.2.0-1PGSTY.el10.x86_64.rpm
ulak_14 0.2.0 el10.aarch64 pigsty 340.5 KiB ulak_14-0.2.0-1PGSTY.el10.aarch64.rpm
postgresql-14-ulak 0.2.0 d12.x86_64 pigsty 288.4 KiB postgresql-14-ulak_0.2.0-1PGSTY~bookworm_amd64.deb
postgresql-14-ulak 0.2.0 d12.aarch64 pigsty 281.8 KiB postgresql-14-ulak_0.2.0-1PGSTY~bookworm_arm64.deb
postgresql-14-ulak 0.2.0 d13.x86_64 pigsty 317.5 KiB postgresql-14-ulak_0.2.0-1PGSTY~trixie_amd64.deb
postgresql-14-ulak 0.2.0 d13.aarch64 pigsty 309.9 KiB postgresql-14-ulak_0.2.0-1PGSTY~trixie_arm64.deb
postgresql-14-ulak 0.2.0 u22.x86_64 pigsty 330.0 KiB postgresql-14-ulak_0.2.0-1PGSTY~jammy_amd64.deb
postgresql-14-ulak 0.2.0 u22.aarch64 pigsty 327.2 KiB postgresql-14-ulak_0.2.0-1PGSTY~jammy_arm64.deb
postgresql-14-ulak 0.2.0 u24.x86_64 pigsty 327.7 KiB postgresql-14-ulak_0.2.0-1PGSTY~noble_amd64.deb
postgresql-14-ulak 0.2.0 u24.aarch64 pigsty 325.0 KiB postgresql-14-ulak_0.2.0-1PGSTY~noble_arm64.deb
postgresql-14-ulak 0.2.0 u26.x86_64 pigsty 327.2 KiB postgresql-14-ulak_0.2.0-1PGSTY~resolute_amd64.deb
postgresql-14-ulak 0.2.0 u26.aarch64 pigsty 323.1 KiB postgresql-14-ulak_0.2.0-1PGSTY~resolute_arm64.deb

Source

pig build pkg ulak;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install ulak;		# install via package name, for the active PG version

pig install ulak -v 18;   # install for PG 18
pig install ulak -v 17;   # install for PG 17
pig install ulak -v 16;   # install for PG 16
pig install ulak -v 15;   # install for PG 15
pig install ulak -v 14;   # install for PG 14

Config this extension to shared_preload_libraries:

shared_preload_libraries = 'ulak';

Create this extension with:

CREATE EXTENSION ulak;

Usage

Sources: README, wiki, v0.0.2 release

ulak implements the transactional outbox pattern inside PostgreSQL. Messages are inserted transactionally, then background workers deliver them asynchronously with retries, circuit breaking, and dead-letter handling.

Enable the Extension

-- postgresql.conf
shared_preload_libraries = 'ulak'

CREATE EXTENSION ulak;

The README also shows setting ulak.database when running the included Docker example.

Define Endpoints and Send Messages

SELECT ulak.create_endpoint(
  'my-webhook',
  'http',
  '{"url":"https://httpbin.org/post","method":"POST"}'::jsonb
);

BEGIN;
  INSERT INTO orders (id, total) VALUES (1, 99.99);
  SELECT ulak.send('my-webhook', '{"order_id":1,"total":99.99}'::jsonb);
COMMIT;

The same API pattern is documented for kafka, mqtt, redis, amqp, and nats endpoints.

Delivery Controls and Pub/Sub

SELECT ulak.send_with_options(
  'my-webhook',
  '{"event":"order.created"}'::jsonb,
  5,
  NOW() + INTERVAL '10 minutes',
  'order-123-created',
  '550e8400-e29b-41d4-a716-446655440000'::uuid,
  NOW() + INTERVAL '1 hour',
  'order-123'
);

SELECT ulak.send_batch('my-webhook', ARRAY['{"id":1}'::jsonb, '{"id":2}'::jsonb]);

SELECT ulak.create_event_type('order.created', 'New order placed');
SELECT ulak.subscribe('order.created', 'my-webhook');
SELECT ulak.publish('order.created', '{"order_id":123}'::jsonb);

Monitoring and Recovery

SELECT * FROM ulak.health_check();
SELECT * FROM ulak.get_worker_status();
SELECT * FROM ulak.get_endpoint_health();
SELECT * FROM ulak.dlq_summary();

SELECT ulak.redrive_message(42);
SELECT ulak.redrive_endpoint('my-webhook');
SELECT ulak.redrive_all();
SELECT ulak.replay_message(100);

Key Settings

The README highlights these ulak. GUCs:

  • workers
  • poll_interval
  • batch_size
  • max_queue_size
  • circuit_breaker_threshold
  • circuit_breaker_cooldown
  • http_timeout
  • dlq_retention_days

The v0.0.2 release notes only document a Docker publish workflow fix, so the current README and wiki remain the authoritative user-facing usage sources.