Home

Awesome

<div align="center">

Sequin

Send Postgres changes anywhere

Docs License: MIT

<p align="center"> <a href="https://console.sequinstream.com">Sequin Cloud</a> · <a href="https://sequinstream.com/docs">Documentation</a> · <a href="https://sequinstream.com">Website</a> </p> </div>

What is Sequin?

Sequin sends Postgres records and changes to your applications and services. It’s designed to never miss an insert, update, or delete and provide exactly-once processing of all changes.

You can receive changes via HTTP push (webhooks) or pull (think SQS).

Use Sequin to add async triggers to your existing Postgres tables to reliably trigger side effects. Or, Sequin can add streaming mechanics to Postgres to do the work of SQS / Kafka without the operational overhead.

Killer features

Cloud

Try Sequin Cloud now →

How Sequin works

Sequin architecture

Sequin keeps your data in your Postgres database. You can use your existing database in a new way without copying the data to a new system or mastering a new technology.

Sequin connects to any Postgres database via the Write Ahead Log (WAL). It captures changes to your Postgres tables, turning them into a stream of messages. Sequin buffers messages to ensure they are delivered and allow for replays and rewinds. You can read those messages over an HTTP interface similar to SQS, or Sequin can push changes to you via webhooks.

Sequin is open source. You can run Sequin in its own Docker container or as a sidecar container in your existing deployment.

Sequin comes with a web console/UI for configuration:

  1. Connect any Postgres database to Sequin (Sequin uses logical replication).
  2. Select the tables, actions, and SQL filters that publish messages to your consumers.
  3. Consume messages using HTTP pull and push interfaces. (You can use our SDKs.)

In production, you can configure Sequin as code using Terraform.

Benchmarks

Sequin efficiently captures changes using the Write Ahead Log. This adds virtually no overhead to the performance of your database. If your database can handle the transaction, so can Sequin with minimal latency.

Postgres Performance is highly dependent on machine resources. But to give you an idea, a db.m5.xlarge RDS instance (4 vCPU, 16 GB RAM, $260/mo) can handle inserts at 5,000 messages/second, with bursts up to 10k messages/second.

Use cases

Trigger side-effects: Never miss a change in your database for processing by other systems. Queue email

Fan out: Add queue capabilities to your database to broadcast events, distribute workloads, and decouple services. Fan out order

Replication: Sync data to other systems to update search indexes, invalidate caches, and generate denormalized views. Sync

Compare Sequin

FeatureSequinPG triggersLISTEN / NOTIFYSupabase WebhooksAmazon SQSPGMQ
Trigger guaranteesTransactionalTransactionalTransactionalTransactionalN/ATransactional
Processing guaranteesExactly-onceExactly-onceAt-most-onceAt-least-onceExactly-onceExactly-once
Order guaranteesFIFO, strict by PKFIFO❌ No❌ NoFIFO option❌ No
Replay✅ Yes❌ No❌ No❌ No❌ No✅ Yes
Filtering✅ Yes✅ Yes✅ Yes✅ PG triggersN/A❌ No
Transformation✅ LUA❌ No❌ No❌ No❌ No❌ No
Backfills✅ Yes❌ No❌ No❌ NoN/AN/A
InterfaceHTTP pull<br />HTTP pushplpgsqlPostgres clientHTTP pushHTTP pullSQL functions
ObservabilitySequin consolePG logging*PG logging*Supabase dashboardAWS consolePG logging*
PerformanceWAL, minimal overheadSerial ops / row^Minimal overheadSerial ops / row^N/APG table limits

<sub>* PG logging: You can configure logging in your database, but nothing is built in. Generally hard to see the state of any given side-effect.</sub>

<sub>^ Serial ops / row: Postgres triggers (which power Supabase Webhooks) run serially within each transaction (and block) and can add significant overhead.</sub>

<details> <summary>PG Triggers v Sequin</summary>

PG Triggers

PG Triggers provide exactly-once processing guarantees within the context of your database. For instance, you can ensure that when a record is inserted in one table, it is appended to another.

Sequin extends this guarantee outside of your database with a simple HTTP interface. Notably, Sequin is much more efficient at processing changes - as the trigger is captured via the WAL while Postgres triggers execute per row, inside transactions.

</details> <details> <summary>LISTEN / NOTIFY v Sequin</summary>

LISTEN / NOTIFY

NOTIFY delivers a message to any channel listening for changes. It's a simple pub/sub model with at-most once delivery guarantees. If a change happens and no channel is available to hear it - it's gone forever.

Sequin adds a HTTP interface and persistent, durable messaging to provide exactly-once processing guarantees to the NOTIFY implementation. Paired with filtering, transforms, and observability - Sequin is easier to use and monitor.

</details> <details> <summary>Supabase Webhooks v Sequin</summary>

Supabase Webhooks

Supabase Webhooks use pg_net to allow you to trigger a HTTP POST or GET from a Postgres Trigger. If a webhook fails, the response is logged (for a period of time).

Sequin adds retries and message persistence to provide exactly-once processing guarantees. Paired with more queue configuration options, Sequin acts as a sort of outbox stream for Supabase.

</details> <details> <summary>Amazon SQS v Sequin</summary>

Amazon SQS

Amazon SQS is a simple queue with an HTTP interface. It can be configured to provide a highly durable, redundant FIFO queue with exactly one processing.

Sequin provides this same functionality with a transactional enqueue guarantee. Sequin also provide an HTTP push interface to enable easy integration with other services.

</details> <details> <summary>PGMQ v Sequin</summary>

PGMQ

PGMQ is a Postgres extension that provides a durable message queue with a SQL interface that mimics SQS methods. It offers exactly-once processing like SQS, but runs entirely in Postgres. You can add message persistence to PGMQ by archiving (instead of deleting) messages - giving you the ability to replay through the queue. However, PGMQ does not provide any order guarantees.

Like PGMQ, Sequin leverages Postgres for persistence and to provide transactional enqueueing. Importantly, Sequin provides both change data captures and durable stream replay and backfill from existing tables in your database. Sequin comes with an HTTP pull and push interface, filtering, transformation, built in observability, and strict ordering guarantees.

</details>

Documentation

For full documentation, visit sequinstream.com/docs.

Quick start

Sequin is available as a cloud version or self-hosted. See the following docs to get up and running quickly:

Contribute

Sequin is open-sourced with an MIT license. The project is just getting started, so the best way to contribute right now is to open an issue or send us a note: support@sequinstream.com