Patterns of Event Driven Architecture - Mark Richards
Richards: Event Forwarding Introduces Duplicates
While preventing data loss, the event forwarding pattern introduces the risk of duplicates. If a service crashes after committing to the database but before acknowledging the message, the message remains on the queue. Another service may then reprocess the same message, leading to a duplicate entry. Handling these duplicates is a necessary consequence of this pattern, requiring additional logic to ensure data integrity.
Domain Broker Pattern Enhances Reliability
The domain broker pattern federates brokers by domain, creating separate architectural quanta. Each domain has its own broker, reducing dependencies and improving system reliability. If one broker fails, other domains continue to function, preventing a system-wide outage. This pattern enhances fault tolerance by isolating failures within specific domains, ensuring the overall system remains operational.
Richards: Domain Broker Adds Complexity
While improving reliability, the domain broker pattern adds complexity and cost. Managing multiple brokers requires additional resources and expertise. This complexity is a trade-off for increased fault tolerance. Organizations must weigh the benefits of improved reliability against the costs of managing a more complex infrastructure, determining if the investment is justified.
Push-Based State Management Destroys Quantum
The push-based state pattern, where services push state changes to a central service, destroys architectural quanta. By requiring all services to write to a central queue, it creates a synchronous dependency on that queue's broker. This coupling negates the benefits of federated brokers, returning the system to a single architectural quantum. This pattern undermines the fault tolerance achieved through domain separation.
Pull-Based State Management Preserves Quantum
The pull-based state pattern, where a state tracker service listens to existing events, preserves architectural quanta. By passively listening to events within each domain, it avoids creating synchronous dependencies. The state tracker maintains a central state machine without requiring services to actively push state changes. This approach maintains the benefits of federated brokers and domain separation, ensuring fault tolerance.
Multi-Broker Pattern Boosts Throughput
The multi-broker pattern increases throughput by using multiple brokers within a domain. Services use a round-robin algorithm to distribute events across these brokers, increasing overall capacity. This pattern is analogous to Kafka's partitioning, where topics are separated into partitions for parallel processing. By adding more brokers, the system can handle a higher volume of events, improving scalability. However, this approach can sacrifice FIFO ordering.
