system-type-event-driven
System Type: Event-Driven
Patterns, guarantees, and failure modes for event-driven and message-based architectures.
Core Patterns
Publish/Subscribe
What it is. Producers publish events to a topic; consumers subscribe and receive independently. Decouples producers from consumers. When to use. Fan-out notifications, audit logging, updating multiple read models, cross-domain integration where the producer shouldn't know about consumers. When to avoid. When you need a synchronous response. When ordering across topics matters. When the number of consumers is always exactly one (point-to-point is simpler).
Event Sourcing
What it is. Store state as a sequence of immutable events rather than current-state snapshots. Current state is derived by replaying events. When to use. Audit requirements (financial, regulatory). When you need to reconstruct historical state. When different consumers need different projections of the same data. When to avoid. CRUD-heavy domains with simple state. When event schema evolution is harder than the audit benefit. When the team has no experience with eventual consistency patterns. When query patterns require complex joins across aggregates.