Build a superfast CDC with Debezium and Quarkus

Build a superfast CDC with Debezium and Quarkus

Change Data Capture (CDC) is widely used in various contexts, such as microservices communication, legacy system modernization, and cache invalidation. The core idea of this pattern is to detect and track changes in a data source (e.g., a database) and propagate them to other systems in real-time or near real-time.

Debezium is a CDC platform that provides a wide range of connectors for most data sources. Beyond capturing changes, it also offers transformation capabilities through an intuitive UI for defining debezium instances. One way to use Debezium is by embedding it in a web application along with a connector to listen for changes in a data source. What’s particularly interesting is that, with some tweaks, it’s possible to build a CDC system with ultra-fast startup times and a minimal memory footprint by leveraging Quarkus and GraalVM.

A bug that hid for years behind a silent SQL clause.

While working on Debezium’s MariaDB connector, I dug into a duplicate-events issue that traced back to a single missing statement: START TRANSACTION WITH CONSISTENT SNAPSHOT. Without it, InnoDB creates the MVCC read view lazily — at the first SELECT, not when the transaction begins. A few milliseconds of concurrent writes in between, and the snapshot quietly drifts past the captured binlog position.