/plushcap/analysis/ably/ably-postgres-connector

Community project showcase: an Ably-Postgres connector to stream DB changes to millions of clients in realtime

What's this blog post about?

The Ably-Postgres connector is a tool that enables listening to changes in Postgres tables and publishing realtime messages on Ably channels whenever a change occurs. It was built by community expert Apoorv Vardhan and can be found on GitHub. This connector allows for the creation of database-driven realtime applications where long-term storage and update triggers from previously published messages are essential, such as an editable chat app. The connector works by accepting a configuration file with connection details for your database and Ably API key. It then creates a special table called ablycontroltable in the database to maintain Ably channel mapping for various changes to tables. Next, it listens to changes on specified tables using the pg_notify function and publishes change data capture (CDC) payloads on relevant Ably channels. The connector can be used with a JSON file or environment variables. It enables a database-driven approach to app architecture similar to Firebase or Supabase, allowing for realtime updates on previously stored data. An example of this is seen in an editable chat application where the PostgresDB is hosted on AWS RDS and the Ably-Postgres Connector is containerized and hosted on AWS Fargate. The connector is open-source and available on GitHub and NPM, with plans for future updates and improvements.

Company
Ably

Date published
Sept. 2, 2021

Author(s)
Srushtika Neelakantam

Word count
1008

Hacker News points
None found.

Language
English


By Matt Makai. 2021-2024.