Daniel Rocco: Pushy Postgres and Python

It’s common for applications to wait for data to arrive in a database. What’s a good way to do that? One is to poll the database every so often, checking to see if our data has arrived. But there’s another way — maybe the database can tell us when something has happened, and we can be informed asynchronously. It turns out that PostgreSQL supports just this sort of notification, using the NOTIFY and LISTEN commands. Moreover, if you’re using Python, you can easily subscribe to PostgreSQL’s notification channels, and wait for PostgreSQL to inform your Python program that new data has come in.  This talk, by Daniel Rocco, shows you how a combination of PostgreSQL and Python makes it quite easy to use these asynchronous notifications.

Leave a Reply