Functional
- Publish messages to named queues or partitions.
- Lease work to consumers and acknowledge completion.
- Retry with delay and quarantine poison messages.
Buffer work durably while coordinating ownership, retries, and poison messages.
Batch sequential appends across many partitions.
Large payloads should use object references.
Raw storage is roughly 1.2 PB before replication at peak.
Coordination must avoid per-message central locks.
These are reference assumptions, not universal facts. In an interview or architecture review, change them when the product context changes.
/v1/queues/{queue}/messagesPublish payload, key, delay, and deduplication token./v1/queues/{queue}/leasesFetch a bounded batch with visibility timeout./v1/messages/{id}/ackAcknowledge or negatively acknowledge a lease generation.partition+offset, id, key, payload_ref, available_at, attemptOffset is immutable; delivery state is separate.message_id, consumer, generation, expires_atGeneration fences late acknowledgements from previous owners.Persist partitioned message logs
Assign consumers to partitions
Process and acknowledge work
Quarantine repeatedly failing messages
A broker appends to its local log and replicates to a quorum before acknowledging. Producers retry with a stable producer/message sequence so uncertain acknowledgements do not create logical duplicates.
The visibility timeout must exceed normal processing but remain recoverable. Consumers heartbeat long jobs. A lease generation prevents an expired worker from acknowledging work now owned elsewhere.
Track oldest-message age per tenant and queue. Enforce publish quotas, weighted consumer scheduling, maximum retry rates, and dead-letter thresholds so one poison workload cannot starve others.
Let the lease expire and redeliver; handlers must be idempotent.
Cap attempts and preserve payload plus failure context in a dead-letter queue.
Move here when: Basic background jobs.
Move here when: Throughput or local ordering grows.
Move here when: Retention, fairness, and large delays dominate.
Strong answer signal: Only within controlled state transitions; external effects need idempotency/transactions.
Strong answer signal: Time-bucketed delay index promotes due messages.
Strong answer signal: Oldest message age, processing latency, and retry rate—not depth alone.