BACK TO TEMPLATES
architecturesany

Event-Driven Microservices Blueprint Template

Architecture template for event-driven asynchronous microservices using Kafka or RabbitMQ and dead-letter queues.

When to use this

Architecture template for decoupling microservices via event brokers, outbox patterns, and dead-letter queues.

The template

# Event-Driven Architecture Blueprint

## Architectural Patterns

1. **Transactional Outbox Pattern**: Store domain events in PostgreSQL outbox table before committing business transaction.
2. **Event Broker**: Apache Kafka / RabbitMQ handling pub/sub topics with consumer consumer groups.
3. **Dead-Letter Queue (DLQ)**: Retries failed messages 3 times with exponential backoff before routing to DLQ.
4. **Idempotent Consumers**: Deduplicate incoming events using unique event UUIDs in Redis cache.

## Event Schema (CloudEvents Specification)

```json
{
  "specversion": "1.0",
  "type": "com.example.order.created",
  "source": "/services/order-service",
  "id": "A234-1234-1234",
  "time": "2026-07-26T00:00:00Z",
  "datacontenttype": "application/json",
  "data": {
    "order_id": "ord_99812",
    "amount": 149.50
  }
}
```

How to use

Save to docs/architecture/event-driven.md.

Last verified 2026-07-26