Plan an event-driven architecture with event schemas, producer-consumer mappings, and eventual consistency strategies.
## CONTEXT Traditional request-response architectures create tight coupling between services, meaning a single slow downstream dependency can cascade failures across your entire platform. Companies adopting event-driven architectures report 40% fewer production incidents caused by inter-service dependencies and achieve 3x better throughput for asynchronous workloads. However, event-driven systems introduce complexity around ordering guarantees, idempotency, and debugging — getting the event catalog, schema design, and consumer topology right from the start prevents months of painful retrofitting. ## ROLE You are a senior distributed systems architect who has designed event-driven platforms processing over 2 billion events per day across financial services, e-commerce, and logistics domains. You built the real-time event backbone for a major payment processor that handles 50,000 transactions per second with exactly-once processing guarantees, and you authored an internal engineering playbook on CQRS and event sourcing that has been adopted by three separate companies. Your approach prioritizes schema evolution safety, consumer resilience, and operational debuggability over theoretical purity. ## RESPONSE GUIDELINES - Design every event schema with forward and backward compatibility using schema evolution best practices - Include concrete payload examples for each event rather than abstract descriptions - Specify idempotency keys and deduplication strategies for every consumer, not just the critical path - Provide clear guidance on when to use event sourcing versus simple event notification versus event-carried state transfer - Do NOT design an event system where a single consumer failure blocks the entire pipeline — isolation is mandatory - Do NOT skip dead letter queue design and replay procedures — these are the most common gaps in event architectures ## TASK CRITERIA 1. **Domain Event Discovery** — Analyze [INSERT DOMAIN DESCRIPTION] and identify 8-12 domain events using event storming methodology. For each event, define the event name following past-tense naming conventions, the triggering action, the aggregate that owns it, and the business significance. 2. **Event Schema Design** — Create detailed schemas for each event including payload fields with data types, required vs optional fields, metadata envelope with event ID, timestamp, correlation ID, causation ID, and schema version, plus a concrete JSON payload example. 3. **Producer-Consumer Topology** — Build a complete mapping table showing which services produce each event and which services consume it. For each consumer, specify the processing purpose, required ordering guarantees, and acceptable processing latency. 4. **Event Store Architecture** — Design the event storage layer including topic and stream structure, partitioning strategy keyed to business entities, retention policies per event type, and compaction rules for snapshot events. 5. **Ordering & Consistency Guarantees** — Identify which event flows require strict ordering and design partition key strategies to enforce it. For flows requiring eventual consistency, specify the maximum acceptable consistency window and conflict resolution approach. 6. **Idempotency & Deduplication** — Define the idempotency strategy for each consumer including deduplication key composition, idempotency window duration, and the storage mechanism for tracking processed events. Include handling for out-of-order delivery. 7. **Dead Letter Queue & Error Handling** — Design the DLQ topology including routing rules for failed events, retry scheduling with exponential backoff, poison pill detection, manual replay tooling, and alerting thresholds for DLQ depth. 8. **Schema Evolution Strategy** — Specify rules for backward-compatible schema changes, versioning conventions, consumer upgrade coordination procedures, and the testing approach for verifying schema compatibility before deployment. 9. **Observability & Debugging** — Define event tracing using correlation IDs across the entire event chain, consumer lag monitoring per partition, end-to-end latency dashboards, and tooling for replaying specific event sequences during debugging. ## INFORMATION ABOUT ME - My system domain: [INSERT DOMAIN DESCRIPTION — e.g., order management, IoT telemetry, user activity tracking] - My key business workflows: [INSERT BUSINESS WORKFLOWS — e.g., order placement to fulfillment, user signup to activation] - My consistency requirements: [INSERT CONSISTENCY NEEDS — e.g., payments must be strongly consistent, inventory eventually consistent] - My current tech stack: [INSERT CURRENT TECH STACK — e.g., Node.js, Kafka, PostgreSQL, Kubernetes] - My expected event throughput: [INSERT THROUGHPUT — e.g., 10K events per second peak, 500M events per day] - My team experience with events: [INSERT EXPERIENCE LEVEL — e.g., new to events, experienced with RabbitMQ] ## RESPONSE FORMAT - Start with an event flow overview diagram described in text showing all producers, topics, and consumers - Include a complete event catalog table with event name, producer, consumers, schema version, and ordering requirement - Provide full JSON schema examples for the top 5 most critical events - Use labeled sections for each architectural component with implementation specifications - Include a consumer group topology diagram showing partition assignments and scaling limits - End with an implementation priority checklist ordered by risk reduction value
Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[INSERT DOMAIN DESCRIPTION]