Fast, real-time
Postgres change data capture
Fast, real-time
Postgres change data capture
Replace brittle workflows or clunky tools like Debezium. Stream data from Postgres directly to SQS, Kafka, and more.
Capture every insert, update, and delete
Capture every insert, update, and delete
Works with any Postgres database
Works with any Postgres database
Push to streams and queues in real-time
Push to streams and queues in real-time
Built in backfills and transforms
Built in backfills and transforms
Open source, MIT license
Open source, MIT license
YAML
CLI
Web console
databases:
- name: "sequin-playground"
username: "postgres"
password: "postgres"
hostname: "sequin_postgres"
database: "sequin_playground"
port: 5432
slot_name: "sequin_slot"
publication_name: "sequin_pub"
tables:
- table_name: "accounts"
table_schema: "public"
sort_column_name: "updated_at"
sinks:
- name: "kafka-sink"
database: "sequin-playground"
table: "public.accounts"
destination:
type: "kafka"
hosts: "kafka1.example.com:9092,kafka2.example.com:9092"
topic: "accounts-topic"
username: "kafka-user"
password: "kafka-password"
sasl_mechanism: "plain"
# 1. Install the CLI using Homebrew
$ brew install sequin
# 2. Apply the YAML config file
$ sequin config apply
Applying changes...
✓ Created database connection: sequin-playground
✓ Added table tracking for public.accounts
✓ Created Kafka sink: kafka-sink
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
# 3. Check the health of the kafka sink
$ sequin sink health kafka-sink
Sink: kafka-sink
Status: Healthy
Messages processed (24h): 127
Guarantees
Guarantees
Guarantees
Capture & deliver
every change
Capture & deliver
every change
Sequin is a tool for change data capture (CDC) in Postgres. Sequin never misses an insert, update, or delete and delivers every (100%) change to your stream or queue.
Sequin is a tool for change data capture (CDC) in Postgres. Sequin never misses an insert, update, or delete and delivers every (100%) change to your stream or queue.
Key features
Key features
Key features
A new standard for change data capture
A new standard for change data capture
Change data capture typically requires adding complicated dependencies, endless configuration, and blackbox runtimes. Sequin is tailored to Postgres to cut out the complexity and deliver helpful features.
Change data capture typically requires adding complicated dependencies, endless configuration, and blackbox runtimes. Sequin is tailored to Postgres to cut out the complexity and deliver helpful features.
SQL filters
Use WHERE clauses to route changes to your sinks.
function onRow(r) {
switch (r.status) {
case 'active': return JSON.stringify('running');
case 'pending': return JSON.stringify('waiting');
default: return JSON.stringify('unknown');
}
}
function onRow(r) {
switch (r.status) {
case 'active': return JSON.stringify('running');
case 'pending': return JSON.stringify('waiting');
default: return JSON.stringify('unknown');
}
}
Transforms
Transform messages with functions.
Backfill
Backfill at any time.
Observable
Trace every row from capture through to delivery
No infra needed
Built-in streaming
Out of the box, you can send database changes to a webhook sink or turn on a Sequin Stream. Both offer a durable, Kafka-like stream with exactly-once processing guarantees and a simple HTTP interface.
//Sequin pushes rows to your HTTP endpoint
//Example lambda handler:
exports.order_handler = async (event) => {
try {
processOrder(event.data.action, event.data.record);
return {
//message will be ack'd
statusCode: 200,
};
} catch (error) {
console.error('Error:', error);
return {
//message will be nack'd & retried
statusCode: 500,
};
}
};
# Receive messages from a consumer
curl -X 'GET' 'https://api.sequinstream.com/consumer/receive'
# Returns
{
"data": [
{
"ack_token": "MTYyeJ7abUjl1pO",
"data": {
"record": {
"id": 1,
"name": "Paul Atreides",
# more fields...
}
}
},
# more messages...
]
}
# Acknowledge a message
curl -X 'POST' 'https://api.sequinstream.com/consumer/ack'
-d '{ "ack_token": ["MTYyeJ7abUjl1pO"] }'
Webhook sink
POST changes from your database to any HTTP endpoint. Built in retries and back-off.
Sequin Stream
Change Retention
Use cases
Streamline your use case
Sequin is designed to power every change data capture use case. No need to master a new piece of infrastructure.
Trigger
Workflows
Create
Audit logs
Replicate
Tables
Maintain
Caches
// Handle order events and trigger workflows
async function handleOrderWorkflow(change) {
// Log the change
await logDatabaseChange(change);
// Only process new orders
if (change.metadata.table_name === 'orders' && change.action === 'insert') {
const order = change.record;
// Update inventory for each item
for (const item of order.items) {
await updateInventory(item.product_id, -item.quantity);
}
}
}
// Update inventory levels and check thresholds
async function updateInventory(productId, quantityChange) {
const { rows } = await db.query(
'UPDATE inventory SET quantity = quantity + $1 WHERE product_id = $2 RETURNING quantity',
[quantityChange, productId]
);
// Trigger alert if inventory is low
if (rows[0].quantity <= 10) {
await db.query(
'INSERT INTO inventory_alerts (product_id, current_quantity) VALUES ($1, $2)',
[productId, rows[0].quantity]
);
}
}
Trigger code when Postgres rows change
Build automated workflows from database changes. Sequin captures and delivers every change in your database so you can break monolithic processes into automated, event-driven workflows.
// Automatically log all database changes with Sequin
async function logDatabaseChange(change) {
await db.query(`
INSERT INTO audit_logs (
event_id,
table_name,
record_id,
action,
old_values,
new_values
) VALUES ($1, $2, $3, $4, $5, $6)
`, [
change.id,
change.metadata.table_name,
change.record.id,
change.action,
JSON.stringify(change.changes), // Previous values
JSON.stringify(change.record) // New values
]);
}
// Example: Capture an order status change
await logDatabaseChange({
id: "evt_123",
action: "update",
metadata: { table_name: "orders" },
record: { id: "order_123", status: "shipped" },
changes: { status: "pending" }
});
Create an Audit Log
Sequin captures the full history of modifications to your data, letting you meet compliance requirements, debug issues, and build powerful user features like activity feeds - all without modifying your application code.
// Replicate tables across databases with Sequin
async function replicateChange(change) {
// Handle inserts, updates, and initial data
if (change.action !== 'delete') {
await db.query(`
INSERT INTO products_replica (
id,
name,
price,
updated_at
) VALUES ($1, $2, $3, $4)
ON CONFLICT (id) DO UPDATE SET
name = EXCLUDED.name,
price = EXCLUDED.price,
updated_at = EXCLUDED.updated_at
`, [
change.record.id,
change.record.name,
change.record.price,
new Date()
]);
} else {
// Handle deletes
await db.query('DELETE FROM products_replica WHERE id = $1', [change.record.id]);
}
}
// Example: Replicate a product update
await replicateChange({
action: "update",
record: { id: "prod_123", name: "Coffee Maker", price: 99.99 }
});
Replicate Tables
Seamlessly replicate data between databases in real-time. Sequin handles the complex parts of database replication - like race conditions, schema transformations, and failure recovery - so you can sync your data with just a few lines of code.
// Keep Redis cache in sync with your database
async function updateCache(change) {
const cacheKey = `products:${change.record.id}`;
if (change.action !== 'delete') {
// Update cache for inserts/updates
await redis.set(cacheKey, JSON.stringify({
...change.record,
cached_at: new Date()
}));
} else {
// Remove deleted items from cache
await redis.del(cacheKey);
}
}
// Example: Cache product update
await updateCache({
action: "update",
record: { id: "prod_123", name: "Coffee Maker", price: 99.99 }
});
Maintain Cache
Keep your caches in sync with your database. Sequin streams changes directly to Redis, Memcached, or your caching layer of choice - eliminating cache inconsistencies and the complexity of manual cache invalidation.
Performance
Performance
Performance
Tuned to Postgres
Tuned to Postgres
Sequin uses logical replication to efficiently capture every change as it happens. If your database can handle the transaction, Sequin can deliver it with minimal overhead.
Sequin uses logical replication to efficiently capture every change as it happens. If your database can handle the transaction, Sequin can deliver it with minimal overhead.
Messages / Second
P95 Latency (MS)
We're happy to host
Sequin Cloud
Fully managed service, we handle the infrastructure
Built to scale, tuned to support high message volume
Get started right away
Get started right away
Widely supported
Widely supported
Widely supported
Works with your stack
Works with your framework
Sequin works with any Postgres database (version 12+) and supports a growing list of sinks to queues and streams. Sequin even supports native sinks (Webhooks and HTTP) so you can get started without any other infrastructure.
Sequin works with any Postgres database (version 12+) and supports a growing list of sinks to queues and streams. Sequin even supports native sinks (Webhooks and HTTP) so you can get started without any other infrastructure.
Community
Community
Community
Open source
Open source
Sequin is completely open source with an MIT license. Follow us on GitHub. Let us know what you want to see!
Sequin is completely open source with an MIT license. Follow us on GitHub. Let us know what you want to see!
Discord
Join the Sequin Discord server to chat with contributors, get support, and discuss your use case.
Pricing
Pricing
Pricing
Plans and pricing
Plans and pricing
Sequin itself is built on Postgres to provide the most efficient, cost effective change data capture on the market.
Open Source
Cloud
Change data capture from Postgres to streams and queues
Change data capture from Postgres to streams and queues
SQL filtering, JS & Go transforms, rewinds, CLI, and web console
SQL filtering, JS & Go transforms, rewinds, CLI, and web console
Docker container to setup and install Sequin with just Postgres and KV dependencies
Discord support
Discord support
Small
Up to 4 vcores
$1000
/ month
per month
Recommended for up to 500 million rows per month.
High-availability with autoscaling
High-availability with autoscaling
White-glove implementation support with dedicated Slack channel
CLI tunnels into local resources
CLI tunnels into local resources
Medium
Up to 8 vcores
$2000
/ month
per 100K delivered rows
Recommended for up to 1 billion rows per month.
For production apps,
pay-as-you-go
High-availability with autoscaling
High-availability with autoscaling
White-glove implementation support with dedicated Slack channel
White-glove implementation support with dedicated Slack channel
CLI tunnels into local resources
CLI tunnels into local resources
Extended data retention for replays
Extended data retention for replays
Large
Up to 16 vcores
$4000
/ month
per month
Recommended for up 1 billion+ rows per month
For businesses with predictable streams
High-availability with autoscaling
High-availability with autoscaling
White-glove implementation support with dedicated Slack channel
White-glove implementation support with dedicated Slack channel
CLI tunnels into local resources
CLI tunnels into local resources
Extended data retention for replays
Extended data retention for replays
24 x 7 production support with SLAs
24 x 7 production support with SLAs
Get in touch
Get in touch
Have more questions or want to talk through your use case first?
©️ 2024 Sequin Labs, Inc. All rights reserved.
©️ 2024 Sequin Labs, Inc. All rights reserved.
©️ 2024 Sequin Labs, Inc. All rights reserved.