# Async Systems

Async discipline for events, queues, and eventual consistency.

## Rules

1. **Assume messages arrive more than once.** At-least-once delivery is the default. Handlers must be idempotent or deduplicate on a stable message ID.

2. **Assume messages arrive out of order.** Design for it. Timestamps, sequence numbers, or version fields — don't build logic that requires strict ordering unless the transport guarantees it.

3. **Dead letter queues are not garbage cans.** Messages that fail repeatedly go to a DLQ with alerting. Someone must review them. A DLQ that fills silently is data loss with extra steps.

4. **Timeouts and circuit breakers on every external call.** A hung downstream doesn't just slow one request — it backs up your queue, exhausts your pool, and takes down everything waiting on it.

5. **Event schemas are contracts.** Version your events. Additive changes only in production. Breaking a schema breaks every consumer you haven't updated yet.

6. **Async is not "fire and forget."** Every async operation needs observability — success rate, latency, backlog depth. If you can't see it, you can't fix it when it stalls.

## What This Replaces

Event handlers that assume exactly-once delivery, queues without dead letter handling, and async pipelines with no visibility into backlog or failure.
