Design
Debezium change capture from PostgreSQL to Kafka for a bank
To stream row changes from PostgreSQL into Kafka, run Debezium on Kafka Connect with logical decoding, and design the replication slot, heartbeat and failover before the first event flows. Debezium is Apache-2.0 licensed, and its latest stable release when we checked was 3.7.1.Final (debezium.io, checked 23 Nov 2026). The PostgreSQL side needs wal_level set to logical, enough replication slots and WAL senders, and a publication that covers only the tables you need. The failure bankers fear is a stuck slot: if the connector stops, PostgreSQL keeps WAL for it and the primary disk can fill. OSStend engineers design the connector, the heartbeat that keeps the slot moving, the topic and schema layout and the alerting on slot lag. Before PostgreSQL 17, logical slots do not follow a failover, so the design states how the connector recovers after one.
45 minutes with an engineer: we review your workload and sketch the design.
- ✓Your cloud account
- ✓Banking
- ✓Design
- Source
- PostgreSQL, logical decoding with pgoutput
- Pipeline
- Debezium on Kafka Connect, then Kafka topics
- Main risk
- Replication slot lag filling the primary disk
- Where it runs
- Your cloud account
- Typical timeline
- 4 to 8 weeks
Typical situation
Trigger. Downstream systems need account and payment events as they commit, without polling the core database.
Versions. PostgreSQL 14 to 17 with the pgoutput plugin, Kafka Connect, Debezium 3.x.
- No extra load that threatens the primary
- Events must not be lost across failover
- Schema changes must not break consumers
A typical situation, not a named customer.
OSStend designs Debezium for PostgreSQL by setting wal_level to logical, scoping a publication, running the connector on Kafka Connect with a heartbeat and alerting on replication slot lag. Slots do not survive failover before PostgreSQL 17, so recovery is designed in.
Customers
Partners
- PostgreSQL
- MySQL
- MongoDB
- Redis
Valkey
- OpenSearch
- Kafka
- RabbitMQ
- AWS
- Google Cloud
- Azure
- Kubernetes
- OpenShift
- Prometheus
- Grafana
- Datadog
- Dynatrace
- Splunk
What OSStend runs and what you keep
OSStend designs the pipeline and then runs Connect and Kafka. You own the source database changes and consumers.
| Area | OSStend | You |
|---|---|---|
| PostgreSQL settings | wal_level, slots, WAL senders and publication scope | Apply the change on the primary |
| Connector config | Snapshot mode, heartbeat, decimal and time handling, topic names | Approve topic naming |
| Kafka and Connect | Brokers, Connect workers and a schema registry, sized and run | Nothing |
| Slot monitoring | Lag and retained WAL alerts | Nothing |
| Failover recovery | Runbook for connector restart after a primary change | Test a failover with us |
| Schema changes | Review of migrations that affect captured tables | Tell us before release |
| Consumers | Advice on idempotency and ordering | Own consumer code |
| On call | Engineers 24/7 | Reach us by phone or ticket |
Where it can run
A bank usually runs Debezium and Kafka next to the database it reads, in its own account or data center.
| Option | When it fits | Licence and source |
|---|---|---|
| Our cloud | Source database is reachable and policy allows it | Apache-2.0 (licence, checked 23 Nov 2026) |
| Your cloud account | Typical: close to the source, data stays in your account | Same licence. See bring your own cloud. |
| Your data center | The database runs on premises | Same licence |
How we run it
The design phase produces a runbook for the stuck slot and for failover. Build and testing follow.
Review the source (3 to 5 days)
We check PostgreSQL version, replication settings, tables, primary keys and write rate. See PostgreSQL change data capture.
Design (1 to 2 weeks)
We set publication scope, topic naming, snapshot mode, heartbeat interval and the schema registry approach.
Build (1 to 2 weeks)
Kafka, Connect and the connector are built in your account. The slot is created with a monitored lag alert.
Test failure (1 to 2 weeks)
We stop the connector, fail over the primary and change a schema in a test copy, then record how recovery works.
First consumer (1 to 2 weeks)
One consumer goes live and we watch lag and event counts.
Run (from day one)
We run it 24/7 on the how it works model. See also managed Kafka.
Cost basis
Debezium has no licence fee, so the cost is Kafka and Connect capacity, the replication load on PostgreSQL and the operating fee.
Size from change volume, not table size: events per second, average row size after the envelope is added and the retention you keep on topics. A topic holding 7 days of 500 events a second at 2 KB an event is about 600 GB (500 x 2,048 x 604,800 seconds), before replication.
| Input | Calculation | Result |
|---|---|---|
| Event rate | 500 events a second | Input |
| Event size | 2 KB with envelope | Input |
| 7-day retention | 500 x 2,048 x 604,800 | About 619 GB per copy |
| Replication factor 3 | Three copies | About 1.9 TB across brokers |
| None | Apache-2.0 | |
| OSStend fee | Quoted per design | See pricing |
Sizing arithmetic from stated inputs. Compression reduces disk use; we test it on your data.
What we watch on call
Change capture has a few classic failures. These are the ones we alert on.
- Slot lag and retained WAL.
- We watch confirmed_flush_lsn against the current LSN and alert before disk use climbs.
- Idle tables.
- A slot on a quiet database does not advance. The heartbeat keeps it moving.
- Failover.
- Before PostgreSQL 17, logical slots are not carried to a new primary, so we rehearse a re-snapshot or a controlled restart.
- Schema changes.
- Dropping or retyping a captured column breaks consumers. We review migrations ahead of time.
- Large transactions.
- A big batch update creates a burst of events. We watch connector lag and Kafka throughput.
- Connector task failures.
- A failed task stops capture silently unless watched. We alert on task state.
When OSStend is not the right fit
This fits banks that need ordered, low-latency change events and want the failure modes designed in.
Contact us if
- ✓Downstream systems need committed changes as events
- ✓You can enable logical replication on the primary
- ✓You need a runbook for failover
- ✓You want Kafka and Connect run for you
Not a fit if
- ✕A nightly batch export meets the need
- ✕You cannot change PostgreSQL replication settings
- ✕Only a few tables change rarely
- ✕You want a no-code tool with a vendor UI
Questions buyers ask
These are the questions we hear most on this situation. Each answer is general; the design review settles the figures for your estate.
What happens if the connector stops?
PostgreSQL keeps WAL for the slot until the connector returns. We alert on lag and set limits so the disk does not fill.
Does failover lose events?
Before PostgreSQL 17, logical slots do not follow a failover. The design states whether we re-snapshot or resume, and we rehearse it.
Do we need Kafka for CDC?
Not always. Debezium Server can write elsewhere. Kafka fits when several consumers need replay. See what CDC is and how tools compare.
Can you run the PostgreSQL too?
Yes, through managed PostgreSQL, which lets us tune replication settings with the CDC design.
Related pages
- Deployment · Your cloud accountBring your own cloud (BYOC) managed databasesBring your own cloud with OSStend: engineers run PostgreSQL, Kafka and more inside your AWS, Azure or Google Cloud account, so data and billing stay yours.
- GuidePostgres CDC: PostgreSQL change data capture explainedPostgres CDC explained: wal_level, replication slots, publications, REPLICA IDENTITY, WAL retention, failover slots, RDS and Aurora settings and Debezium, from the docs read 19 Nov 2026.
- How it worksHow OSStend works: design, move, runOSStend designs your cluster around the workload, moves it in with zero downtime and runs it 24/7. See the three steps and what turnkey services leave out.
- KafkaManaged Kafka in your cloud or data centerManaged Kafka with the broker count, partition plan, KRaft, Connect and an Apicurio or Karapace schema registry designed for your estate, run 24/7 in your cloud or data center.
- PricingDatabase as a service pricing: dedicated, tailoredDatabase as a service pricing from OSStend: dedicated, tailored clusters priced by engine, size, SLA tier and location. Enterprise only, with no free tier.
- GuideChange data capture (CDC): methods and toolsChange data capture explained: log-based vs query-based CDC, the main CDC tools, Postgres CDC and replication slots, and when to pay someone to run it.
Design your CDC safely
Share your write rate and PostgreSQL version and we will draft the design.
- ✓A design sketch for your workload, not a plan menu
- ✓A zero-downtime cutover path for what you run today
- ✓A price for that design, after the review





