Post

🚨 New Blog Post 🚨 I just finished this monster of a blog post! How to listen to database changes through the Postgres WAL! This is all @filipecabaco.com's fault who nerd-sniped me into low-level Postgres details! Click here to suffer too: peterullrich.com/listen-to-da... #ElixirLang #Postgres

peterullrich.comListen to Database Changes through the Postgres WALAn in-depth guide to listening to Postgres database changes through the WAL. Covers logical replication, publications, replication slots, and an Elixir implementation.

13 reposts46 likes

Reading. So far so good. But whenever I've been distracted and navigated away and return your site shows the lovely red error LiveView internet connection box. Immediately. Until the WebSocket reconnects. I suggest only showing that if it actually takes more than 5 seconds if at all :)

A light theme?! Who uses a light theme these days? :P But fair enough. I wanted to update my blog anyways and will add DaisyUI which should make this easy. Thanks for the suggestion!

Great post, Peter. Now, regarding the persistent replication, maybe some type of cleanup routine could help mitigate the possible con, or it's not possible?

Thank you! That's what the temporary replication slot is for! But you can also delete the replication slot with another migration if you decide to remove the listener from your application for example. Is that what you meant?

I re-read and I missed this part: "When it comes back online, the replication slot will send the WAL records it has missed.". So yes the only issue would be if you remove the listener but not the replication slot, so I migration would fix it. Thanks. :)