Show HN: PgHook – Docker image that streams PostgreSQL row changes to webhooks

github.com

39 points by enadzan 4 days ago

I needed real-time updates in a web UI whenever PostgreSQL table rows change, so I built PgHook. It's a 23 MB Docker image (10.1 MB compressed), .NET9 AOT-compiled, that streams logical replication events and sends them to a configurable webhook.

In my setup, the webhook converts events to SignalR messages that push updates to the UI.

I know about Debezium but I needed something minimal, and I like playing with csharp.

tasn 4 days ago

Congrats on the launch! I'm biased, but you should probably consider changing the webhooks to follow https://www.standardwebhooks.com/ for greater compatibility and library support.

  • enadzan 2 days ago

    I’ve added optional support for standard webhooks headers and the signature scheme in the latest version.

  • enadzan 4 days ago

    Thanks for checking it out! At this point I was focused on solving a specific problem, but improving compatibility is definitely worth looking into.

yyyyyn 2 days ago

Have you found a chance to look into the LISTEN/NOTIFY? You don't have to rely on logical replication slots, which may be a win.

  • enadzan 2 days ago

    Yes, but (as far as I understand) LISTEN/NOTIFY would require adding triggers to the tables I need to track. Also, if the PgHook container is down, NOTIFY events would be lost — for UI updates that’s not critical, but it’s a limitation.

    I’ve been experimenting with logical replication [1] for a while, and it felt like a simpler fit here.

    [1] https://github.com/PgOutput2Json/PgOutput2Json