Skip to content

Tiering plan: record durability decision A + reconcile tech-plan#100

Merged
renanfulas merged 2 commits into
mainfrom
codex/reconcile-tiering-tech-plan
Jun 29, 2026
Merged

Tiering plan: record durability decision A + reconcile tech-plan#100
renanfulas merged 2 commits into
mainfrom
codex/reconcile-tiering-tech-plan

Conversation

@renanfulas

@renanfulas renanfulas commented Jun 29, 2026

Copy link
Copy Markdown
Owner

O que foi feito

Canoniza a arquitetura de persistência em camadas e fecha a decisão que estava em aberto, além das correções de precisão do tech-plan.

Decisão (fecha A vs B, §4/§11)

Opção A: Postgres write-through = âncora síncrona de durabilidade; Redis = cache/estado quente não-crítico; backup off-box e fan-out = assíncronos via outbox (append por-turno, nunca snapshot/flush diário como fronteira de durabilidade).

As ideias da Opção B (desenho do Renan: Redis como verdade operacional + Postgres noturno) viram uma escada de escalada incremental sob gatilho (Redis hot state → read cache 7d → Redis-first localizado), em vez de descarte — a A cresce pra dentro da B quando o volume provar a necessidade.

Reconciliações do tech-plan

  • Próxima migration é a 012 (011 já aplicada; 010 é gap não usado).
  • Fase 0 (sink off-box) marcada como prep-feita, bloqueada só por creds R2.
  • Fix de typo no DDL (BIGGENERATED).

Doc-only.

🤖 Generated with Claude Code

renanfulas and others added 2 commits June 29, 2026 13:49
The detailed tiering tech-plan was stale in a few spots: the next free migration
is 012 (011 is already applied; 010 is an unused gap), Phase 0 (off-box sink) is
prepped on the VPS and blocked only on R2 credentials, and the summaries table DDL
had a BIGGENERATED typo. No design change — accuracy only, ahead of implementing
the SessionStateStore seam (slice 2) and the nightly summarization (slice 5).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Closes the open A-vs-B decision in the layered-persistence plan: Postgres
write-through stays the synchronous durability anchor; the off-box backup is a
per-turn outbox append (never a periodic snapshot or nightly flush as the
durability boundary). Renan's Redis-operational-truth design (Option B) is kept
as a triggered escalation ladder (Redis hot state, then read cache, then local
Redis-first) rather than discarded, so A can grow into B incrementally when
volume actually demands it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@renanfulas renanfulas changed the title Reconcile tiering tech-plan (migration 012, sink prep status, SQL fix) Tiering plan: record durability decision A + reconcile tech-plan Jun 29, 2026
@renanfulas renanfulas merged commit 8933a99 into main Jun 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant