Looks cool. Seems like a good alternative if you can’t use listen/notify for some reason. I’ve used listen/notify with triggers for a while with good success. The flexibility of my apps controlling what they want to listen for instead of having that config elsewhere. Downside to l/n is that if you aren’t listening you aren’t getting changes. Seems like the same is true if the webhook fails here since there isn’t a re…
Unfortunately, most of these LR programs don't work in AWS (RDS) land, since they require PG plugins, and RDS LR only supports the built-in test decoder. I wrote a similar program that uses LR to stream changes to AWS's Kinesis[1], using a mini library that parses the output of the default test decoder[2] as a result, in case anyone else is in RDS and has the same limitation. [1] https://github.com/nickelser/pg_kines…
Show HN: Skor – Drop-in microservice to get Postgres changes as JSON webhooks
31–39 of 39 posts
Re: Show HN: Skor – Drop-in microservice to get Postgres changes as JSON webhooks
#32Looks cool. Seems like a good alternative if you can’t use listen/notify for some reason. I’ve used listen/notify with triggers for a while with good success. The flexibility of my apps controlling what they want to listen for instead of having that config elsewhere. Downside to l/n is that if you aren’t listening you aren’t getting changes. Seems like the same is true if the webhook fails here since there isn’t a re…
Hi I did use Debezium in a Kubernetes cluster to stream Postgres changes into Kafka and then through a custom application that can send them to clients via HTTP or WebSockets. But the entire system had multiple points of failure. So we then decided to write our own thing that connects to the LR slot and sends over WebSockets. Working on open sourcing that too!
Re: Show HN: Skor – Drop-in microservice to get Postgres changes as JSON webhooks
#33Re: Show HN: Skor – Drop-in microservice to get Postgres changes as JSON webhooks
#34Re: Show HN: Skor – Drop-in microservice to get Postgres changes as JSON webhooks
#35This looks cool, and another approach is pg_amqp_bridge to send events like this into rabbit. A nice feature is that the triggers don't block: https://github.com/subzerocloud/pg-amqp-bridge You can then push to websockets from rabbit with STOMP https://www.rabbitmq.com/web-stomp.html
Thanks for posting this. Can already see a couple of weekends burned trying to drive celery from pg.
Do you know if it is used in production somewhere; how battle-tested is it?
Re: Show HN: Skor – Drop-in microservice to get Postgres changes as JSON webhooks
#36Earlier quoted context omitted.
100 webhook calls as the trigger is executed whenever a row is modified. Postgres's per statement triggers don't let you capture the rows that are modified and skor doesn't do any sort of batching currently.
> Postgres's per statement triggers don't let you capture the rows that are modified They do these days. Since 10 you can specify: REFERENCING { { OLD | NEW } TABLE [ AS ] transition_relation_name } [ ... ] ] in a FOR EACH STATEMENT ... AFTER trigger.
Re: Show HN: Skor – Drop-in microservice to get Postgres changes as JSON webhooks
#37This looks cool, and another approach is pg_amqp_bridge to send events like this into rabbit. A nice feature is that the triggers don't block: https://github.com/subzerocloud/pg-amqp-bridge You can then push to websockets from rabbit with STOMP https://www.rabbitmq.com/web-stomp.html
> pg_amqp_bridge Thanks for posting this. Can already see a couple of weekends burned trying to drive celery from pg. Do you know if it is used in production somewhere; how battle-tested is it?
Re: Show HN: Skor – Drop-in microservice to get Postgres changes as JSON webhooks
#38Earlier quoted context omitted.
Hi I did use Debezium in a Kubernetes cluster to stream Postgres changes into Kafka and then through a custom application that can send them to clients via HTTP or WebSockets. But the entire system had multiple points of failure. So we then decided to write our own thing that connects to the LR slot and sends over WebSockets. Working on open sourcing that too!
can you talk more about the points of failure? and is there a place I could sign up for more information when you open source your websocket solution?
Well the system had Postgres -> Debezium -> Kafka -> CustomApp -> Client. If data stopped flowing through the system, I would have to examine each component to figure the issue out. They'd mostly turn out to be Kubernetes network issues such as Kafka brokers not being able to talk to each other, or Debezium not being able to contact Kafka. This was too painful to run when all we wanted was notifications of changes on Postgres.
If you drop me a note with your email, I'll make sure to get in touch with you when our solution using Postgres LR exposed over WebSockets (and more) is out :)
Re: Show HN: Skor – Drop-in microservice to get Postgres changes as JSON webhooks
#39This problem is one of my biggest needs with postgres, although its certainly not limited to pg. listen/notify is fragile - you either have a single point of failure or you run multiple workers and have to deal with de-duping. Logical replication might one day be an answer, but not likely to ever work completely and without issue on cloud hosted instances. (maybe im wrong about this... see debezium comments elsewhere…