Architecture & API Design
Target: Claude 3.7, Cursor, Windsurf, ChatGPT

Event-Driven Architecture & Message Ordering Review

Review Kafka, RabbitMQ, or SQS/SNS event architectures for exactly-once semantics, out-of-order delivery, and DLQs.

KafkaEvent-DrivenRabbitMQSQSArchitectureBackend

Interactive Prompt Playground

Customize Template Fields
Live replacement
{{EVENT_PAYLOAD}}
{{CONSUMER_CODE}}
{{BROKER}}
{{SCALE}}
Rendered Prompt (Ready to paste)1673 characters
You are an Event-Driven Distributed Systems Architect specializing in Apache Kafka, AWS SQS/SNS, and RabbitMQ.

Review the following asynchronous event pipeline and consumer logic:

Event Schema & Publishing Logic:
```json
{
  "eventId": "evt_98765",
  "eventType": "order.payment_completed",
  "aggregateId": "ord_101",
  "timestamp": 1718000000,
  "data": {
    "amount": 99.00,
    "currency": "USD",
    "customerId": "cust_456"
  }
}
```

Consumer Architecture & Processing:
```
async function onMessage(msg) {
  const event = JSON.parse(msg.value);
  await db.orders.update({ id: event.aggregateId }, { status: 'PAID' });
  await emailService.sendReceipt(event.data.customerId, event.data.amount);
}
```

Message Broker: Apache Kafka (Confluent Cloud)
Throughput / Scale: 5,000 events/sec with strict in-order processing per order

Inspect and harden this event architecture:
1. **Ordering Guarantees & Partition Keying**:
   - Are messages partitioned by a consistent entity key (e.g. `tenant_id` or `user_id`) to guarantee FIFO ordering?
   - What happens when a partition rebalances?
2. **Idempotency & Deduplication**:
   - How does the consumer prevent duplicate processing when the broker delivers messages at-least-once?
   - Is there a unique event ID or version constraint stored in the database?
3. **Dead-Letter Queues (DLQ) & Poison Pills**:
   - Are transient network errors retried with exponential backoff while non-retryable serialization bugs are sent to a DLQ?
4. **Schema Evolution**:
   - Is the payload backward and forward compatible (Avro, Protobuf, or JSON Schema)?

Output a comprehensive design evaluation and robust consumer implementation.

How to Use This Prompt

  1. Paste your event payload and consumer processing logic.
  2. Specify your message broker (Kafka, SQS, RabbitMQ).
  3. Get hardened idempotency patterns, DLQ retry loops, and partition key advice.

Engineering Tips & Best Practices

  • Always include event version and idempotency keys in message headers or envelope schemas.

What This Prompt Inspects

Key failure modes, design principles, and quality standards evaluated during execution.

Idempotent Consumers

Verifies consumer checks processed_events table inside a transaction before side-effects.

Partition Key Uniformity

Ensures high-cardinality partition keys prevent consumer lag and hot partitions.

Poison Pill Isolation

Routes malformed payloads to DLQ without stalling the entire topic partition.

SprintKit Workflow Integrations

Complementary interactive tools and workflows across SprintKit to accelerate your engineering process.

Related Prompts

Explore related developer prompts in this workflow domain.

All Prompts

Microservices Boundary & Domain-Driven Design Decomposition

Deconstruct monoliths or complex systems into bounded contexts with clear domain events and data ownership.

MicroservicesDDDArchitectureSystem Design
2 variablesCustomize prompt

RESTful API Design & Backward Compatibility Review

Design or review RESTful API contracts for idempotency, pagination, error models, and non-breaking versioning.

APIRESTOpenAPIArchitecture+1
3 variablesCustomize prompt

Technical Design Document (RFC) Generator

Generate thorough, engineering-ready Request for Comments (RFC) and Architecture Decision Records (ADRs).

ArchitectureRFCADRPlanning+1
3 variablesCustomize prompt