Core Idea

The Horror Story Pattern is a distributed transaction coordination pattern: asynchronous communication, atomic consistency per step, and choreographed coordination where services react to events without a central orchestrator.

The Horror Story Pattern (AAC) coordinates distributed transactions with three defining properties: Asynchronous communication (services exchange events via message brokers), Atomic consistency (each step is an ACID transaction with immediate consistency), and Choreographed coordination (services react to domain events without a central orchestrator—workflow emerges from autonomous reactions). Named “Horror Story” because, like anthology horror films where disconnected characters independently respond to events, services react autonomously with no single “storyteller” controlling the narrative.

How It Works

  • Event-driven choreography: Services subscribe to domain events, execute a local ACID transaction, then publish the next event
  • No central state: Workflow state is distributed—services track progress via correlation IDs; no single component knows the full saga state
  • Asynchronous propagation: Events flow through a message broker (Kafka, RabbitMQ) with temporal decoupling
  • Distributed compensation: On failure, the detecting service publishes a compensating event; downstream services react by reversing their own committed changes

Trade-Offs

Advantages:

  • Maximum service autonomy—no orchestrator dependency
  • No single point of failure; saga continues while the message broker is available
  • High throughput through parallel asynchronous event processing

Disadvantages:

  • Extremely difficult debugging—must correlate events across broker logs to reconstruct execution
  • Compensation logic scattered across services with no central view of rollback sequence
  • No built-in timeout detection for “stuck” sagas where an expected event never arrives
  • Cyclic event chains possible if service reactions are not carefully designed

Sources

Note

This content was drafted with assistance from AI tools for research, organization, and initial content generation. All final content has been reviewed, fact-checked, and edited by the author to ensure accuracy and alignment with the author’s intentions and perspective.