The situation
Our CDC goes from Debezium to Kafka, then through our own sinks into BigQuery. Kafka is the biggest part to run, and we were also looking at moving it to Confluent Cloud (this idea has been dropped later). Before that, we wanted to know if we could rely less on it.
Debezium Server can write changes directly to a target, without Kafka. With its Iceberg sink, the changes land as Iceberg tables in Cloud Storage, and BigQuery can read them as external tables.
How we tested it
We tested it in three steps:
- Locally, on MySQL and MongoDB: inserts, updates, deletes, schema changes, snapshots and bulk changes.
- On staging, with real traffic and bigger tables.
- On production, with two connectors: one for a table with hundreds of millions of rows, and one for small tables.
We also quickly tried the Debezium Server BigQuery sink, which writes to BigQuery directly.
What we found
- Locally, it worked. New columns were added automatically and deletes were marked. A breaking type change stopped the connector, as expected.
- Upsert mode didn’t work with BigQuery. It creates Iceberg delete files, and BigQuery fails to read them with a “too many equality constraints” error. We moved to append mode.
- Slow startup. The connector writes its schema history event by event, which took about 30 minutes for 1,000 events.
- Snapshots. Initial snapshots of big tables failed, so we used incremental snapshots instead.
- The blocker: when an incremental snapshot restarts, a timestamp column changes type, and the connector stops. The BigQuery sink had the same problem. We opened an issue and a forum thread with the maintainers.
- MongoDB: without a sink in between to force a schema, some documents can’t land in BigQuery, for example field names it doesn’t accept, or nested lists.
On production, the small connector worked, and its tables matched the existing ones. The big one failed on the snapshot.
The decision
It wasn’t ready for our setup back in the time, so we decided to move on with the Kafka work without it. I believe that the solution has evolved and Debezium Server with Iceberg and BigQuery are covering many of the limitation we faced.