Skip to content
rusthacks.dev

Library

Everything you need to level up your coding skills.

Flat illustration for the post “Fan Out and Fan In Work Pipelines in Rust Services Design”, composed around threads.
Architecture

Fan Out and Fan In Work Pipelines in Rust Services Design

Split work across a bounded pool of workers and merge the results: a producer, bounded channels for backpressure, N workers, a collector and clean shutdown. A Tokio pipeline with ordering, errors and cancellation handled.

5 min read
Flat illustration for the post “Observability Architecture for Rust Services Explained”, composed around deploy.
Architecture

Observability Architecture for Rust Services Explained

Logs, metrics and traces answer different questions. Wire them together with tracing and OpenTelemetry in a Rust service: one instrumentation API, a collector, context propagation across services and sensible sampling.

5 min read
Flat illustration for the post “Circuit Breakers and Bulkheads in Rust Service Clients”, composed around architecture.
Architecture

Circuit Breakers and Bulkheads in Rust Service Clients

Stop one failing dependency from taking the whole service down. A circuit breaker fails fast after repeated errors and probes for recovery; a bulkhead caps concurrency per dependency. Implement both with Tokio.

5 min read
Flat illustration for the post “Request Limits and Slow Client Attacks in Rust Services”, composed around web.
Security

Request Limits and Slow Client Attacks in Rust Services

Slow clients and oversized requests exhaust connections and memory. Set header and body timeouts, body size limits, concurrency limits and keep-alive bounds at the proxy and in the Axum service with Tower layers.

5 min read
Flat illustration for the post “Stale While Revalidate Caching in Rust Services Explained”, composed around perf.
Performance

Stale While Revalidate Caching in Rust Services Explained

Serve the cached value immediately, even if slightly old, and refresh it in the background. Learn the idea, the HTTP Cache-Control directives and an in-process implementation with a freshness window and a grace window.

4 min read

Get new posts by email

We send one email when a new post is published. No spam.

Unsubscribe in one click. No spam, ever.