LearningTech

Event-Driven

Transactional Outbox Pattern

Description

See 'Outbox Pattern' in Distributed Systems. Uses a local transaction to ensure event reliability.

Where to use

  • Guaranteed delivery.

Real World Example

Writing the event to a SQL table in the same transaction as the business entity.

Code Example

class TransactionalOutboxPattern:
    def __init__(self):
        pass

    def execute(self):
        print('Executing Transactional Outbox Pattern')