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:\n    def __init__(self):\n        pass\n\n    def execute(self):\n        print('Executing Transactional Outbox Pattern')