Get the latest tech news

The notifier pattern for applications that use Postgres


Maximizing Postgres connection econonmy by using a single connection per program to receive and distribute all listen/notify notifications.

Especially for languages like Go that make a in-process concurrency easy and cheap, the notifier reduces listen/notify connection overhead to practically nil. The inner closure calls into WaitForNotification, but has a default context timeout of 30 seconds that automatically cycles the function periodically. Given there’s now a single master connection that’s handling all notifications for a program, it’s fairly critical that its health be monitored, and the notifier reacts appropriately.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of applications

applications

Photo of Postgres

Postgres

Photo of notifier pattern

notifier pattern

Related news:

News photo

Pg_lakehouse: Query Any Data Lake from Postgres

News photo

2D Gold Sheet Draws Graphene Comparisons. Applications expected in water-to-hydrogen tech and efficient electronics.

News photo

Wprs – rootless remote desktop for Wayland (and X11, via XWayland) applications