Which design pattern is used when a microservice needs to atomically perform a database write and send a notification event using a single local transaction?
The Transactional Outbox pattern addresses the distributed-system dual-write problem by recording both the business-state change and an outgoing event within one local database transaction. Rather than attempting to atomically update a database and independently publish to a messaging platform, the service writes the event into an outbox table alongside the business update. Because both database modifications occur within the same transaction, they commit or roll back together. A separate publisher subsequently reads the outbox and sends the event to the messaging infrastructure. Oracle ' s current microservices architecture documentation explicitly identifies Transactional Outbox as the pattern for sending a message and performing a data manipulation operation within a single local transaction. Saga and CQRS address different distributed-system concerns.
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit