Quarkus Outbox Packing Domain Aggregate to Stream Analytics

Quarkus Outbox Packing Domain Aggregate to Stream Analytics

2025, Jun 05    

Just a preview of the content, I will write a full post about this topic in the future.

The dual-write problem is a common challenge in microservices architectures, where two or more services need to maintain consistency across their data stores. This can be particularly difficult when one service needs to update another service’s data store, as it can lead to issues with data integrity and reliability.

Architecture

My Reference Architecture diagram

The diagram below illustrates a reference architecture for handling transactional changes and addressing the dual-write problem using the Outbox pattern. By leveraging the relational database’s Write-Ahead Log (WAL) and Debezium for change data capture (CDC), only relevant business events are published. This approach avoids the need to monitor all database tables, ensuring that only intentional, consistent changes are streamed to downstream systems.

Image-1: Simplified architecture for Outbox with Quarkus

Technology stack

  • Docker Compose for local development and testing
  • PostgreSQL as the source database
  • Quarkus for building the outbox service

Repository with demo project

All the components are open-source and can be run on any cloud provider or on-premises. The technology. I will not list here because everything will be in the code repository.

https://github.com/drr00t/ppajm-apcn-quarkus/tree/main/sakila-sa-cdc

Disclaimer: This repository is a work in progress and is not a recommendation and I will do not provide a full documentation about configuration options. My idea with this it’s to provide some glance of how to use the technology stack and how to put it together.

References

The Transactional Outbox Pattern Eliminating the Dual-Write Problem in Apache Kafka Using the Outbox Pattern: Transactional outbox