Process PostgreSQL Changes With Logical Replication And Ruby

Amirhosein Zlf
CodeX
Published in
7 min readMay 2, 2022

--

Have you ever tried to send your database activity logs to an event system? Get the latest changes so you could manage your cache better or even trigger other events based on data changes.

In PostgreSQL with the Logical Decoding feature, you could easily get the latest changes every time something changed in your database. Here we are going to set up the Logical Decoding first and then create a script to push these changes to Kafka, Redis, or any stream-processing platforms for further usage.

--

--

Amirhosein Zlf
CodeX
Writer for

Tech enthusiast with a love for Football, Formula 1, and Snooker. A fan of Real Madrid, Mercedes AMG Petronas F1 Team, Ronnie O'Sullivan, and Coldplay.