Architecture Best Practices
Boundaries, cohesion, and API stability keep Rust codebases maintainable as teams and traffic grow.
Busca en todas las páginas de la documentación
Boundaries, cohesion, and API stability keep Rust codebases maintainable as teams and traffic grow.
main wires config and server only.[workspace.dependencies] pins. serde, tokio, axum aligned.--workspace. All members green.domain + api + infra for typical Axum/sqlx service.
Until 2+ deployables or compile pain; then workspace.
types crate ok; avoid dumping ground.
Each service own workspace; share domain lib via crate publish.
api crate tailored to UI DTOs separate from public API crate optional.
polars worker crate; API orchestrates jobs async.
auth crate boundary + supply chain audit.
C4 or simple dependency mermaid in ARCHITECTURE.md.
CI script grep forbidden imports in domain.
ADR with removal milestone; no unbounded exception.
Stack versions: This page was written for Rust 1.97.0 (edition 2024), Tokio 1.x, Axum 0.8, serde 1.0, sqlx 0.8, clap 4, and Polars 0.46+.
Revisado por Chris St. John·Última actualización: 16 jul 2026