# Streams

Append ordered durable events, replay by dense offset, and retain history with explicit policies.

Ferrite Streams provide an append-only ordered history. Each accepted record
receives a dense offset that consumers can checkpoint and replay.

## Use a stream for history

Choose Streams for audit events, domain events, analytics input, change feeds,
and any sequence where order and replay matter. Choose a Queue when one worker
should own each unit of work.

```rust filename="src/audit.rs"
let mut audit = ctx.topics("security-events")?;
let offset = audit.append(&event_bytes).await?;
```

Named topics multiplex application streams while preserving per-topic
retention and consumer progress.

## Retention and replay

Set retention according to the product and legal need. A consumer stores its
last committed offset and resumes from the next record after restart. When a
consumer falls behind retention, surface the missing range and recover from a snapshot or
domain read model; do not silently skip events.

## Audit data

Append security and administrative events without secrets, tokens, passwords,
or raw signed assertions. Include the tenant, pseudonymous subject when known,
event type, outcome, time, request correlation, and reason class.

See [Analytics & Usage](/developers/analytics/) and [Reliability](/developers/reliability/).
