# Architecture Decision Record — Queue or Direct Call?

## Document Directory

This paste contains 3 documents:

- [README.md](https://marke.st/p/01M33QKM91QDT2CMVXKJBSNYDF/README.md) ← (current)
- [decisions/0007-async-exports.md](https://marke.st/p/01M33QKM91QDT2CMVXKJBSNYDF/decisions/0007-async-exports.md)
- [templates/adr.md](https://marke.st/p/01M33QKM91QDT2CMVXKJBSNYDF/templates/adr.md)

---

## README.md

# Queue or direct call?

### Preserve the reasoning—not just the final diagram.

**ARCHITECTURE / DECISION RECORD / REUSABLE TEMPLATE**

> A fictional design decision for an export feature. Workload figures and requirements below are invented assumptions, not measurements or vendor benchmarks.

## The decision in one screen

| Question | Answer in this scenario |
|---|---|
| What are we deciding? | Where long-running exports should execute |
| What did we choose? | A durable job record, a queue, and a background worker |
| Why? | The assumed export duration exceeds the request-time budget |
| What did we accept? | More operational pieces and eventual completion |
| What would change our minds? | Evidence that exports are consistently small and immediate results are essential |

```text
Client ──> API ──> Job record + outbox
                         │
                    Outbox relay
                         │
                         ▼
                       Queue ──> Worker ──> Artifact store
                                  │
                                  └──> Job status
```

The outbox is part of this proposal so accepting a job and recording its dispatch intent do not depend on two unrelated writes succeeding together. Implementation still needs tests for duplicate delivery, retries, and reconciliation.

## Read or reuse

[Read the filled-in ADR](decisions/0007-async-exports.md) or [start with the blank template](templates/adr.md).

## What makes the record useful?

The constraints are named. Alternatives receive a fair explanation. Costs are explicit. Revisit triggers are measurable. The reader can tell the difference between an assumption and a result.

**This is not a claim that queues are always better.** Under different latency requirements or workloads, the direct-call option could be the simpler choice.

---
*An original example published with [Marke.st](https://marke.st). Share a decision with the context that made it reasonable.*