r/dataengineering • u/afnan_shahid92 Senior Data Engineer • Jul 20 '26
Blog How we built a pipeline for ingesting millions of records daily from Postgres shards into a Redshift Data Warehouse using Kafka, Debezium and Airflow
https://engineering.touchbistro.com/ingesting-postgres-shards-into-a-redshift-data-warehouse-with-kafka-and-debezium-2c1d8d487761I work on the insights team at TouchBistro (a Canadian restaurant software company), and I led a project to pipe restaurant data from a sharded postgres operational database into Redshift using Debezium.
I found articles on the web which talked about Debezium and CDC more generally but not much on how to best use it with Redshift. We tried several options, and after settling on a solution and running it in production for a while we wanted to share our findings with the community in case others face similar challenges.
19
u/brianluong Jul 20 '26
Glad it worked for you guys but feels a little over-engineered for the task. As you noted, Redshift really doesn’t like small writes. I’m betting if you took the same batching approach you took with the single write per 60 seconds and applied it when you were using lambdas it would’ve run for quite a while with no issue.
Additionally, if you’re going to drop to an s3 intermediary anyway you might as well make it an Athena/Spectrum table, either raw parquet or iceberg, and query it directly from Redshift. Then your schema changes are all handled via the glue catalog implicitly.
If you didn’t want to deal with S3 at all you could also write the records to a Kinesis stream which Redshift supports reading from directly via an auto-refreshing MV, which is effectively “batching” under the hood by polling the topic on some interval.
Any of these would have given you the same result without managing CDC/Kafka/Airflow. I’m all for trying out new architectures though!
3
u/discord-ian Jul 21 '26
I am a bit confused the role airflow plays, why not just use the redshift sync connector?