Postgres LISTEN/NOTIFY does not scale
1–10 of 328 posts
Re: Postgres LISTEN/NOTIFY does not scale
#2Interesting. What if you just execute `NOTIFY` in its own connection outside of / after the transaction?
Re: Postgres LISTEN/NOTIFY does not scale
#3Rls and triggers dont scale either
Re: Postgres LISTEN/NOTIFY does not scale
#4Interesting. What if you just execute `NOTIFY` in its own connection outside of / after the transaction?
Isn’t it standard practice to have a separate TCP stream for NOTIFY or am I mistaken
Re: Postgres LISTEN/NOTIFY does not scale
#5Right, plus there's character limitations (column size). This is why I prefer listening to the Postgres WAL for database changes:
https://github.com/cpursley/walex?tab=readme-ov-file#walex (there's a few useful links in here)
Re: Postgres LISTEN/NOTIFY does not scale
#6I appreciate this post for two reasons:
* It gives an indication of how much you need to grow before this Postgres functionality starts being a blocker.
* Folks encountering this issue—and its confusing log line—in the future will be able to find this post and quickly understand the issue.
Re: Postgres LISTEN/NOTIFY does not scale
#7Interesting. What if you just execute `NOTIFY` in its own connection outside of / after the transaction?
My thought as well. You could add notify commands to a temp table during the transaction, then run NOTIFY on each row in that temp table after the transaction commits successfully?
Re: Postgres LISTEN/NOTIFY does not scale
#8You had one problem with listen notify which was a fair one, but now you have a problem with http latency, network issues, DNS, retries, self-DDoS, etc.
Re: Postgres LISTEN/NOTIFY does not scale
#9Facebook’s wormhole seems like a better approach here - just tailing the MySQL bin log gets you commit safety for messages without running into this kind of locking behavior.
Re: Postgres LISTEN/NOTIFY does not scale
#10Sounds like one centralized Postgres instance, am I understanding that correctly? Wouldn’t meeting bots be very easy to parallelize across single-tenant instances?