You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the middle term (before adding more tables), we should:
Research to confirm if the current crate is the best one. Change it if it's not.
Add migrations.
Split the database trait into many different traits per context. Otherwise, it will end up having too many methods.
I think I will implement the metrics persistence with the current drivers because I want to finish the[+] stats overhaul,[/+][-] stats overhaul,[/-] but we should consider implementing this epic before continuing to add more tables (complexity) to the current persistence layer, especially if we decide to change it.
The implementation has been broken down into 9 sequential sub-issues. Each one is independently reviewable and mergeable into develop before PostgreSQL support is complete.
The full specs have been merged into develop via PR #1702. Links below point to each spec file.
Phase 1 — Make the change easy
#
Sub-issue
Short description
Spec
Status
1
1525-01 Persistence test coverage
Add a Bash compatibility-matrix runner that tests the tracker against all supported SQLite, MySQL, and PostgreSQL versions
Add a benchmark runner (--before-image/--after-image CLI) that measures announce throughput so every subsequent step can be compared against a concrete baseline
Split the monolithic Database trait into four narrow context traits (SchemaMigrator, TorrentMetricsStore, WhitelistStore, AuthKeyStore) plus a blanket Database aggregate supertrait
Replace every Arc<Box<dyn Database>> consumer with the specific narrow trait it actually needs; introduce DatabaseStores struct to replace Arc<Box<dyn Database>> in TrackerCoreContainer
Add PostgreSQL as a first-class backend using async sqlx, with four history-aligned migrations, testcontainers-based driver tests, container config, and user-facing documentation
Activity
josecelano commentedon May 22, 2025
Alternatives
josecelano commentedon Mar 6, 2026
An article about Rust, PostgreSQL, and sqlx by @skerkour
https://kerkour.com/rust-postgres-everything
cc @da2ce7
docs(issues): add implementation specs for EPIC #1525 overhaul persis…
Merge #1702: docs(issues): add implementation specs for EPIC #1525 ov…
josecelano commentedon Apr 22, 2026
Implementation Plan
The implementation has been broken down into 9 sequential sub-issues. Each one is independently reviewable and mergeable into
developbefore PostgreSQL support is complete.The full specs have been merged into
developvia PR #1702. Links below point to each spec file.Phase 1 — Make the change easy
1525-01-persistence-test-coverage.md1525-02-qbittorrent-e2e.md--before-image/--after-imageCLI) that measures announce throughput so every subsequent step can be compared against a concrete baseline1525-03-persistence-benchmarking.mdDatabasetrait into four narrow context traits (SchemaMigrator,TorrentMetricsStore,WhitelistStore,AuthKeyStore) plus a blanketDatabaseaggregate supertrait1713-1525-04-split-persistence-traits.mdArc<Box<dyn Database>>consumer with the specific narrow trait it actually needs; introduceDatabaseStoresstruct to replaceArc<Box<dyn Database>>inTrackerCoreContainer1525-04b-migrate-consumers-to-narrow-traits.mdr2d2/rusqlite/mysqlwith asyncsqlxconnection pools for both existing drivers, without introducing PostgreSQL yet1525-05-migrate-sqlite-and-mysql-to-sqlx.mdsqlx::migrate!()and add a legacy-bootstrap path that history-aligns pre-v4 databases1525-06-introduce-schema-migrations.mdNumberOfDownloadsfromu32tou64and the corresponding columns fromINTEGERtoBIGINTvia a versioned migration1525-07-align-rust-and-db-types.mdPhase 2 — Make the easy change
sqlx, with four history-aligned migrations, testcontainers-based driver tests, container config, and user-facing documentation1525-08-add-postgresql-driver.mdEPIC planning doc:
1525-overhaul-persistence.mdfeat(tracker-core): add persistence benchmark runner
Merge #1711: docs(1525-03): align persistence benchmarking spec with …
4 remaining items
Merge #1720: feat(tracker-core): introduce sqlx schema migrations (su…
Merge #1722: feat(tracker-core): widen mysql download counters to big…
feat(tracker-core): add PostgreSQL database driver
Merge #1724: feat(tracker-core): add PostgreSQL driver (subissue #1723)
docs(issues): close epic 1525 persistence overhaul
Merge #1725: docs(issues): close EPIC #1525 persistence overhaul
refactor(udp-server): [torrust#2245] share one BEP 15 i32 clamp betwe…
refactor(udp-server): [torrust#2245] share one BEP 15 i32 clamp betwe…
refactor(udp-server): [torrust#2245] share one BEP 15 i32 clamp betwe…
refactor(udp-server): [torrust#2245] share one BEP 15 i32 clamp betwe…