
SQLx Connection Pools Sizing and Timeouts in Rust Explained
A pool that is too small queues requests and one that is too large exhausts the database. Learn how to size it from your server's limits, set timeouts and spot the symptoms.
Everything you need to level up your coding skills.

A pool that is too small queues requests and one that is too large exhausts the database. Learn how to size it from your server's limits, set timeouts and spot the symptoms.

Feature flags multiply build configurations. See the combinations that fail, how cargo hack tests them, and rules for additive features that keep builds safe.

Share a pool, config and caches with Axum's State extractor. Learn why the state must be Clone, when to use Arc and how to mutate shared data safely.

One blocking call inside an async task can freeze a worker thread. See how it happens, how to find it and the three fixes: spawn_blocking, a thread, or async APIs.

buffer_unordered runs up to N futures from a stream at once and yields results as they finish. See bounded fan out, error handling and how it differs from join_all.

Static dispatch resolves the call at compile time and dynamic dispatch looks it up in a vtable at run time. See the layout, the cost and when it matters.

A Stream is the async version of Iterator. See next().await, StreamExt adapters, creating streams from channels and iterators, and where Stream is headed.

Ownership is three rules the compiler checks for every value. This post builds a mental model from them and uses it to predict what compiles before you run the compiler.

A Semaphore hands out a fixed number of permits so only N tasks run a section at once. See acquire, owned permits, fairness and common limits to set.

Commit Cargo.lock for applications and, per current Cargo guidance, for libraries too. See what the file records, how cargo update changes it and what --locked does in CI.

Share state in async code with Arc<Mutex<T>>, with a state owning task and channels, or with read heavy structures. See the trade-offs and the failure modes.

Every crate you add runs with your privileges, and build scripts and proc macros run at compile time. Learn how advisories work, how to read a RustSec entry and how to limit the surface.
We send one email when a new post is published. No spam.