# PostgreSQL LISTEN/NOTIFY

DevFeed: [PostgreSQL LISTEN/NOTIFY](<https://devfeed.tech/articles/postgresql-listen-notify-34605.md>)

Original publisher: [Read original article](<https://tapoueh.org/blog/2018/07/postgresql-listen/notify/>)

Author: Dimitri Fontaine PostgreSQL Major Contributor; Author

Published: 2018-07-19T10:58:21Z

Content type: tutorial

Language: en

Sources: [Dimitri Fontaine](<https://devfeed.tech/sources/dimitri-fontaine.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Caching](<https://devfeed.tech/topics/caching.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [GeoJSON](<https://devfeed.tech/topics/geojson.md>)

Tags: [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [cache](<https://devfeed.tech/tags/cache.md>), [caching](<https://devfeed.tech/tags/caching.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [golang](<https://devfeed.tech/tags/golang.md>), [json](<https://devfeed.tech/tags/json.md>), [notifications](<https://devfeed.tech/tags/notifications.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>)

## AI overview

A tutorial on using PostgreSQL LISTEN and NOTIFY with a Golang service to maintain an in-memory cache in an external application layer. It explains asynchronous notifications, message payloads, and trigger-driven cache updates.

## Source excerpt

This article fits in the PostgreSQL Concurrency series, where we installed a tweeter like application schema and had all the characters from Shakespeare's A Midsummer Night's Dream tweet their own lines in our database in PostgreSQL Concurrency: Data Modification Language. A previous article in the series covered how to manage concurrent retweets in an efficient way: Computing and Caching, where we learn how to maintain a cache right in your PostgreSQL database, thanks for materialized views. Today's article shows how to maintain an external cache in another application layer. In this article we are going to maintain an in-memory cache in a Golang service, using PostgreSQL LISTEN and NOTIFY features.