Build Real Time Data Pipelines with #PostgreSQL and Apache #Nifi: #CDC via logical replication and #Outbox via table polling.
The Outbox Pattern offers simple operations and explicit control over event schemas, making it well-suited for event-driven architectures where you control the source application.
The CDC Pattern is ideal when you need the complete change history or must capture changes from applications you can't modify. However, it requires more operational overhead (compared to outbox) to manage replication slots and WAL growth.
Choose CDC (Logical Replication) when:
You need to include all changed data, including legacy applications you can't modify
Your schema changes are database-driven
You build a data lake or audit log is required including complete change history
Choose Outbox Pattern when:
You focus simpler operations
You manage and implement the application that is the source of data changes
You need explicit control over event schema and content
You implement event-driven architecture with self- or well-defined domain events
https://www.lotharschulz.info/2026/01/05/building-real-time-data-pipelines-with-cdc-outbox-postgresql-and-apache-nifi/