Developer Documentation
Database Partitioning Plan
Database Partitioning Plan
Partitioning is prepared but not automatically applied. MySQL partitioning has strict rules around unique keys and foreign keys, so production rollout must be rehearsed on a restored backup.
Candidate Tables
transactions: monthly partitions bycreated_atledger_entries: monthly partitions bycreated_ataudit_logs: monthly partitions bycreated_atrequest_logs: monthly partitions bycreated_atwebhook_events: monthly partitions bycreated_at
Optional Scripts
database/optional/partition_transactions.sqldatabase/optional/partition_ledger_entries.sqldatabase/optional/partition_audit_logs.sql
Rollout Plan
1. Confirm MySQL/MariaDB version and partitioning support.
2. Restore the latest production backup into staging.
3. Run optional partition script against staging.
4. Validate inserts, unique constraints, foreign keys, and query plans.
5. Benchmark dashboard, monitoring, and transaction history endpoints.
6. Schedule production migration during maintenance only.
Keep recent partitions hot and archive old partitions to cheaper storage after regulatory retention is defined.