TL;DR
Primero insertar dato en base datos y desde ahi (message relay) publicarlo en cola.
The Transactional Outbox Pattern is a crucial architectural design pattern used in microservices to ensure reliable message publishing to Apache Kafka. It solves the dual-write problem, which occurs when a service tries to update its local database and send an event to Kafka at the same time.
Because databases and Kafka cannot share a single distributed transaction, a network failure or application crash right after the database commit means the Kafka event is lost forever. The outbox pattern completely eliminates this risk by leveraging the atomicity of local database transactions.
https://developer.confluent.io/courses/microservices/the-transactional-outbox-pattern/
https://www.decodable.co/blog/revisiting-the-outbox-pattern
https://microservices.io/patterns/data/transactional-outbox.html


No comments :
Post a Comment