Fyle Stories

Share this post
Stream PostgreSQL CDC events via PGEvents
stories.fylehq.com

Stream PostgreSQL CDC events via PGEvents

Siva Narayanan
Dec 9, 2022
7
1
Share this post
Stream PostgreSQL CDC events via PGEvents
stories.fylehq.com

Background PostgreSQL introduced a feature called logical decoding in version 9.4. This poorly-named feature allows us to do some very cool things like build a stream of events corresponding to changes to the table. Imagine something like this: You have your ORM layer that connects to the DB and inserts, updates, deletes rows in a DB transaction. Now imagine you are able to run an event processor that receives these changes once the DB transaction is committed i.e. the changes are final. You’ll receive the complete row data including old and new value in case of an update to an existing row.

Read →
  • New First
  • Chronological
© 2023 Sivaramakrishnan Narayanan
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing