Skip to content

Kaptanto

Capture database changes as a real-time stream and pipe them wherever you want.

GoPostgresMongoDBgRPCSSE

Why do I <3 that: You can use CDCs for a lot of things, and didn't noticed... yet.

What it does

Kaptanto connects to Postgres WAL or MongoDB Change Streams and emits a unified stream of database events. You can consume those events via stdout (NDJSON), HTTP Server-Sent Events, or gRPC.

How to use

Run the binary against your database and pick an output:

kaptanto --source postgres --output sse --port 8080

Consumers connect and receive events as rows change. Cursors are persisted per consumer, so restarts resume from the last acknowledged event.

Pipe NDJSON into another tool:

kaptanto --source mongo --output ndjson | jq .

Subscribe over gRPC from your own service:

stream, _ := client.Subscribe(ctx, &kaptanto.Subscription{
    Consumer: "payments-worker",
})

Download a release for your platform, or install with Go:

go install github.com/olucasandrade/kaptanto@latest

Want more of that? See details here

https://github.com/olucasandrade/kaptanto