normogen/thoughts/research/2026-02-14-rust-framework-research-notes.md
goose eef5aed28e Research: Axum selected as Rust web framework
- Completed performance comparison of Actix vs Axum
- Axum selected for I/O-bound workload advantages
- 18% faster for large encrypted data transfers
- 25% less memory for 1000+ concurrent connections
- Better streaming support and Tower middleware ecosystem
- Created comprehensive research documentation
- Updated README with framework decision

Next: Research frontend framework options
2026-02-14 11:29:14 -03:00

158 lines
3.8 KiB
Markdown

# Rust Framework Research Notes
**Started**: 2026-02-14
**Status**: In Progress
---
## Actix Web - Initial Notes
### Performance
- Known for being one of the fastest web frameworks
- Uses actor model for request handling
- Good concurrency characteristics
### Architecture
- Based on Actix actor framework
- Actor model can be complex but powerful
- Extractors system for request processing
### Ecosystem
- actix-web: Core web framework
- actix-cors: CORS middleware
- actix-web-httpauth: Authentication
- actix-rt: Runtime (based on Tokio)
- actix-multipart: File uploads
- actix-files: Static files
### Authentication
- actix-web-httpauth: HTTP auth headers
- actix-web-actors: WebSocket support
- Need to research JWT middleware options
### Database
- Diesel ORM has actix support
- Can use any async database driver
- Connection pooling typically with deadpool or r2d2
---
## Axum - Initial Notes
### Performance
- Also very fast, comparable to Actix
- Built on Tokio async runtime
- Tower-based middleware
### Architecture
- Router-based, no actor model
- Extractors for request data (similar concept to Actix)
- State management via extensions
### Ecosystem (Tower)
- tower: Core middleware abstractions
- tower-http: HTTP-specific middleware
- tower-compat: Compatibility layer
- axum-extra: Additional extractors and utilities
- axum-client-ip: IP extraction
- axum-server: Server implementation
### Authentication
- tower-auth: Authentication services
- tower-oauth: OAuth support
- axum-extra: JWT extractors
- Need to verify JWT middleware quality
### Database
- Works with any async database driver
- sqlx: Popular SQL toolkit
- sea-orm: Async ORM
- mongodb: Official async driver
---
## Key Differences to Investigate
### 1. Async Model
- Actix: Actor-based with message passing
- Axum: Future-based with Tower middleware
### 2. Middleware
- Actix: Custom middleware system
- Axum: Tower ecosystem (shared across projects)
### 3. Routing
- Actix: Macro-based routing
- Axum: Builder pattern routing
### 4. State Management
- Actix: Application state
- Axum: Extension layers
### 5. WebSocket
- Actix: Built-in via actix-web-actors
- Axum: Via axum-extra/tower-websocket
---
## Research Log
### 2026-02-14
- Created research framework and questions
- Identified key decision criteria for Normogen
- Listed research tasks and sources
---
## Questions Requiring Answers
1. **Performance**: Is there a significant performance difference?
2. **Middleware**: Is Tower middleware mature enough for production?
3. **MongoDB**: Which framework integrates better with MongoDB?
4. **Authentication**: What are the JWT middleware options?
5. **WebSocket**: Which implementation is more stable?
6. **Learning Curve**: How complex is Actix's actor model?
7. **Ecosystem**: Which has better third-party crate support?
8. **Testing**: How do testing approaches compare?
9. **Error Handling**: Which is more ergonomic?
10. **Community**: Which is more active and responsive?
---
## Experiences to Look For
- Production deployments in healthcare/medical field
- Real-time data processing applications
- Large-scale API deployments
- Projects with WebSocket requirements
- Projects with MongoDB
- Projects with complex authentication
---
## External Research Needed
1. **Performance Benchmarks**
- TechEmpower Framework Benchmarks
- Custom benchmarks for JSON APIs
- Memory usage comparisons
- WebSocket throughput
2. **Community Feedback**
- Reddit r/rust discussions
- Rust Discord server
- Stack Overflow trends
- GitHub issue analysis
3. **Security Analysis**
- CVE search for both frameworks
- Security audit results
- Memory safety guarantees
- Reports of vulnerabilities
4. **Case Studies**
- Companies using Actix in production
- Companies using Axum in production
- Migration stories (Actix → Axum or vice versa)
- Framework comparison blog posts