# ADR-005: MySQL for Persistence + Redis for Feature Store

Status: Accepted | Date: 2026-05-21

## Context
Jube uses PostgreSQL. mw-core uses MySQL (MyXQL). Should we switch?

## Decision
Keep MySQL for persistent storage. Add Redis for feature store.

## Justification
- MySQL handles everything Jube uses PostgreSQL for: JSON columns, compound indexes,
  transactions, foreign keys, full-text search.
- risk_scores.feature_snapshot stored as JSON column (MySQL 5.7+ supports this natively).
- Migrating to PostgreSQL would require rewriting all 29 existing migrations and
  Ecto schema changes — significant risk with no functional benefit at this stage.
- Redis is mandatory regardless of SQL choice (Jube requires it; ETS cannot replace
  Redis for multi-node cluster state sharing).
Note: Can revisit PostgreSQL migration in future if analytical query complexity grows.

---