Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Remote PostgreSQL Outbox

The Remote PostgreSQL Outbox sink delivers messages from one outbox to another outbox on a different PostgreSQL instance. This enables multi-cluster federation — messages published in one data center or region can be forwarded to outboxes in other regions, where local relays deliver them to local consumers. This creates a hierarchical event distribution topology.

When to Use This Sink

Choose this sink for multi-region deployments where events published in one region need to be available to consumers in other regions, or for organizational boundaries where different teams manage separate PostgreSQL clusters but need shared event streams.

Configuration

SELECT tide.relay_set_outbox(
    'replicate-to-eu',
    'orders',
    'federation-relay',
    '{
        "sink_type": "pg_outbox",
        "target_url": "${env:EU_DB_URL}",
        "target_outbox": "orders_eu_replica",
        "batch_size": 200
    }'::jsonb
);

Configuration Reference

ParameterTypeDefaultDescription
sink_typestringMust be "pg_outbox"
target_urlstringPostgreSQL URL for the target instance
target_outboxstringTarget outbox name
batch_sizeint100Messages per batch

Further Reading