Skip to content
Dashboard
Theme
Theme

Sign-ins during database outages

The implemented bounded fallback buffer and its limits.

View Markdown

The broker can continue validated sign-ins during a database outage using its already loaded configuration snapshot and the cell’s fallback buffer. This requires reachable Valkey and available buffer capacity. It is an implemented mechanism, not a hosted availability or SLA claim.

The sign-in path uses the loaded snapshot instead of reading configuration from the database. Signature, issuer, audience, expiry, replay, state and code-consumption checks still run. Buffering changes where the sign-in record is written; it never makes an invalid identity-provider response acceptable.

When the database write fails with a classified unavailability error, the broker seals the record and appends it to a bounded per-cell Valkey stream. Other database errors fail closed. New records for a connection with pending buffered records queue behind them, including after the database returns, to preserve order.

This does not keep management APIs, configuration changes or every dashboard operation available. Those operations can still require the database. It does not cover missing snapshots, a failed Valkey service or arbitrary infrastructure loss.

A full buffer refuses a successful sign-in with sign_in_buffer_full rather than issuing a result whose record would be lost. An unreachable buffer also fails the successful sign-in closed. Capacity is bounded; this mechanism cannot sustain an unlimited outage.

Refused consumed flows have different recording semantics: the refusal page does not wait on the database. A bounded background writer tries to record them through the same buffer, but a writer failure can be logged and the refusal record dropped. Those flows issue no application authorization code. Do not claim every denied attempt is durably preserved.

The worker flushes the stream under a fenced lease. It inserts the sign-in row and applicable outbox event idempotently by sign-in identity, commits, then deletes the stream entry. A crash after commit but before deletion retries without creating another row or event. Later records on a blocked connection wait while other connections can continue.

Exactly-once here refers to persistence of those buffered records and their applicable outbox events. It does not promise exactly-once webhook delivery or exactly-once effects in your application. Webhook consumers still need deduplication and safe retries.

Sign-in history and materialized profiles can appear after recovery rather than during the outage. An older flushed profile does not replace a newer one. See history and timelines for the visibility limits.