Home / Companies / Ably / Blog / September 2021

September 2021 Summaries

3 posts from Ably

Filter
Month: Year:
Post Summaries Back to Blog
This article discusses the architecture and implementation of a serverless editable chat app using database-driven realtime messaging. The main components include NuxtJS for frontend web development, Ably for enabling pub/sub pattern, AWS Lambda functions to insert and update rows in PostgresDB, hosted on AWS RDS, Ably Postgres connector to watch changes on the database tables and publish messages on every change, AWS Fargate with AWS ECS and AWS ECR to deploy the Ably Postgres connector's dockerized image, Netlify to host the static Jamstack site, and Netlify functions to enable a token auth endpoint to authenticate with Ably. The Ably Postgres connector is a key dependency that makes this architecture possible.
Sep 28, 2021 2,070 words in the original blog post.
In this tutorial, we learn how to build a minimal Ably SDK using NodeJS. We start by setting up the project and installing its dependencies. Then, we create an Ably class capable of connecting to Ably via a WebSocket connection. Next, we implement methods for attaching to channels, detaching from channels, publishing messages on a channel, entering presence, and leaving presence on a channel. Finally, we discuss why using an Ably SDK is preferable over building one's own solution in production environments.
Sep 07, 2021 3,181 words in the original blog post.
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.
Sep 02, 2021 1,008 words in the original blog post.