v0.1.0 — Rust · 7.2 MB · MIT

React to your database
in real time

Watch specific column changes in PostgreSQL and fire webhooks, Slack messages, or Telegram alerts the instant they happen. Single binary, zero polling, no middleware.

How it works

Three autonomous agents communicating through bounded channels. Natural backpressure means a slow destination slows the filter, which slows the source.

+--------------------------------------------------------------------+
|                              setu                                    |
|                                                                      |
|  +------------------+    +------------------+    +----------------+  |
|  |   1. Ingress     |    |   2. Filter      |    |   3. Egress    |  | ---> Webhook
|  | (PostgreSQL WAL) | ==>|  (Rule Engine)   | ==>| (HTTP Delivery)|  | ---> Slack
|  | pgoutput decode  |    | column conditions|    | linear backoff |  | ---> Telegram
|  +------------------+    +------------------+    +----------------+  |
+--------------------------------------------------------------------+
       |                                                   |
       | (change stream)       (offset feedback loop)      |
       v                                                   v
+--------------+                                    +-----------------+
|  PostgreSQL  |                                    |  OffsetTracker  |
|  logical     | <================================== |  at-least-once  |
|  replication |                                    |  LSN confirmed  |
+--------------+                                    +-----------------+

Built for production

Single binary, deterministic schema mapping, and at-least-once delivery guarantees.

Pluggable Sources

Abstract IngressSource trait with PostgreSQL implementation via logical replication. MySQL, Kafka, and more ahead.

  • PostgreSQL native pgoutput binary protocol
  • Auto-creates slot + publication
  • Schema drift handled at runtime

Conditional Rules

Match by table, operation type (Insert/Update/Delete), and old/new column values. YAML-driven, no code changes needed.

  • Wildcard * table and op_type matching
  • Old/new value comparison on any column
  • Multiple destinations per rule

At-Least-Once Delivery

Offset confirmed to the source only after the target returns 2xx. Crash-safe replay from the last confirmed LSN.

  • Linear backoff retry (3 attempts)
  • Offset tracker feedback loop
  • Structured tracing logging at every step

Real problems, real time

Enterprise buyers don't pay for an engine — they pay to decrease churn and increase conversions. Setu triggers actions within milliseconds of a database change.

Abandonment Recovery

Trigger a personalized SMS or push notification within 90 seconds of a user abandoning a cart or a loan application.

e-commerce fintech

In-App Personalization

Change the home screen UI of a streaming or gaming app based on live clickstream data during that specific session.

media gaming

Fraud Prevention

Flag transactions or behavioral anomalies instantly by evaluating actions against a live rule engine before processing finishes.

fintech security

Get started in seconds

Docker demo with Postgres, the engine, and a live webhook dashboard — one command.

docker-compose.yml one-command demo
git clone https://github.com/dataengineergaurav/setu
cd setu

docker compose -f demo/docker-compose.yml up --build -d
# Open http://localhost:8080 for live dashboard

docker compose -f demo/docker-compose.yml cp demo/seed.sql postgres:/tmp/seed.sql
docker compose -f demo/docker-compose.yml exec postgres \
  psql -U postgres -d activation_demo -f /tmp/seed.sql
activation.yaml yaml config
pg_connection: "host=localhost port=5432 dbname=mydb \
  user=postgres password=secret"
replication_slot: "activation_slot"
publication: "activation_pub"

rules:
  # Fire webhook when user upgrades to premium
  - table: "users"
    op_type: Update
    conditions:
      - field: "plan"
        old_value: "free"
        new_value: "premium"
    destination:
      type: webhook
      url: "https://hooks.example.com/user-upgraded"
      headers:
        X-Signature: "whsec_..."

  # Post to Slack on new orders
  - table: "orders"
    op_type: Insert
    conditions: []
    destination:
      type: slack
      url: "https://hooks.slack.com/services/T00/B00/xxxxx"
      channel: "#orders"
native build ~40 s cold build
# Requirements: Rust 1.85+, PostgreSQL 12+ with wal_level=logical
cargo build --release
cp activation.yaml my-config.yaml
# Edit config, then:
RUST_LOG=info ./target/release/setu

Three destinations

Fire events to webhooks, Slack channels, or Telegram bots with full payload control.

Webhook

HTTP POST with full change payload as JSON. Custom headers supported.

POST /hook
Content-Type: application/json
X-Signature: whsec_...

Slack

Formatted Slack messages with event details sent to any channel.

type: slack
url: https://hooks.slack.com/...
channel: "#sales"

Telegram

Bot API messages with HTML parse mode. Supports environment variable secrets.

type: telegram
url: https://api.telegram.org/
bot{BOT_TOKEN}/sendMessage

Performance metrics

Measured on a 2023 M-series MacBook Pro. Single static binary, no JVM or Python deps.

7.2 MB
Release binary
~40 s
Cold build time
<3 s
Incremental build
44
Unit tests in ~6.3 s
<1 ms
Event → delivery latency
1024
Channel capacity per link
3
Retry attempts
MIT
License

Interested in Setu?

Leave your email and we'll keep you posted on releases, guides, and production tips.

Or check out the project directly