This is the last part of the series. Over fourteen parts, linkbox went from cargo new to an API with users, sessions, validation, a PostgreSQL database and a test suite. All of it has only ever run on my machine. This part gets it ready to run somewhere else.
Here's the plan. We'll write a Dockerfile that builds linkbox in one image and ships it in a much smaller one. We'll run it next to Postgres with Docker Compose. Along the way, I hit a problem I didn't expect: stopping the container took over ten seconds and ended with the process being killed. Fixing that means handling shutdown signals properly, which every server needs anyway. Then we'll make the app read all its settings from the environment, log JSON, and get a smaller binary. Finally, we'll look at where to host it, and what a production deployment needs that this one doesn't have yet.
Everything here ran on Rust 1.100.0, Axum 0.8.9 and SQLx 0.9.1, with Docker Compose 5.1.4 and PostgreSQL 18.7. Every output is real. The hosting section is different, and I'll say why when we get there.
What you're actually deploying
Deploying a Node app means shipping your code, your node_modules, and the right version of Node to run them. Deploying a Rust app means shipping one file. cargo build --release produces a single binary with your code and every dependency compiled into it. There's no runtime to install, no npm ci on the server, no version manager.
That binary still depends on a few things from the operating system, mainly the C standard library (glibc on most Linux systems), so a binary built on one Linux distribution usually runs on another with the same or newer glibc. You could build on your laptop and copy the file to a server with scp. People do. But linkbox also needs PostgreSQL, a way to restart if it crashes, and a build that works the same everywhere. Docker handles all three, and it's what most hosting platforms expect, so that's what we'll use.
A multi-stage Dockerfile
Building Rust needs the whole toolchain: the compiler, cargo, the standard library sources, and a linker. The official rust image has all of it, and it's big:
$ docker images rust
rust:latest 2.37GB
Running linkbox needs none of that. A multi-stage build uses one image to build and a second, small one to run. Only the files you explicitly copy across end up in the final image. Here's the Dockerfile, in the project root next to Cargo.toml:
# ---- build stage: a full Rust toolchain ----
FROM rust:1.100-trixie AS build
WORKDIR /app
# Build only the dependencies first. This layer is cached until
# Cargo.toml or Cargo.lock changes, so code changes skip it.
COPY Cargo.toml Cargo.lock ./
RUN mkdir src \
&& echo "fn main() {}" > src/main.rs \
&& touch src/lib.rs \
&& cargo build --release \
&& rm -r src
# Now the real code. SQLX_OFFLINE makes the query macros read .sqlx
# instead of connecting to a database.
COPY . .
ENV SQLX_OFFLINE=true
RUN touch src/main.rs src/lib.rs && cargo build --release
# ---- runtime stage: only what the binary needs ----
FROM debian:trixie-slim
RUN useradd --system --uid 10001 linkbox
COPY --from=build /app/target/release/linkbox /usr/local/bin/linkbox
USER linkbox
ENV PORT=3000
EXPOSE 3000
CMD ["linkbox"]
There's a lot in those lines, so let's go through it.
Pinning matching images
rust:1.100-trixie pins both the Rust version and the Debian release it's built on (Debian 13, codenamed trixie). The runtime image is debian:trixie-slim, the same release without the extras. Matching them matters because of glibc: a binary built against a newer glibc won't start on an older one. If you build on rust:latest and run on an older Debian, things work until the day rust:latest moves to a newer Debian, and then your container fails to start with an error about a missing GLIBC_2.xx version. Pin both, and change them together.
Caching dependencies
Docker caches each step, and reuses the cache until something that step depends on changes. If the Dockerfile did COPY . . and then cargo build, any change to any file would invalidate that step, and Docker would recompile every dependency from scratch. linkbox's Cargo.lock lists 241 crates.
The trick is to build the dependencies on their own first. The first COPY brings in only Cargo.toml and Cargo.lock. Then I create a fake src/main.rs and an empty src/lib.rs, build, and delete them. That compiles every dependency into target/ and produces a useless binary. Because this step only depends on the two Cargo files, Docker reuses it until you add, remove or upgrade a dependency.
Then COPY . . brings in the real code, and the second cargo build only has to compile linkbox itself. The touch before it is important. COPY keeps the files' original modification times, and those can be older than the fake files from the previous step. Cargo decides what to rebuild by comparing times, so without the touch, it can conclude that nothing changed and give you the fake binary that does nothing. It's an unpleasant bug to debug, because the build succeeds.
Here's the first build, from nothing:
#11 [build 4/6] RUN mkdir src && echo "fn main() {}" > src/main.rs && touch src/lib.rs && cargo build --release && rm -r src
#11 DONE 75.5s
#13 [build 6/6] RUN touch src/main.rs src/lib.rs && cargo build --release
#13 DONE 8.6s
Seventy-five seconds for the dependencies, under nine for linkbox. After changing one comment in src/lib.rs, the whole rebuild took 12 seconds:
#11 [build 4/6] RUN mkdir src && echo "fn main() {}" > src/main.rs && touch src/lib.rs && cargo build --release && rm -r src
#11 CACHED
#13 [build 6/6] RUN touch src/main.rs src/lib.rs && cargo build --release
#13 DONE 9.2s
If you outgrow this trick (it gets awkward with workspaces of several crates), cargo-chef is a tool that does the same thing more thoroughly. It's worth knowing it exists.
SQLx without a database
The query macros from part 12 check every query against a real database at compile time. There's no database inside a Docker build. SQLX_OFFLINE=true tells the macros to read the .sqlx folder instead, which cargo sqlx prepare generated. That's why parts 12 to 14 kept running prepare after every query change. If .sqlx is out of date, this build fails, which is much better than it succeeding with unchecked queries.
The migrations folder gets copied in too. sqlx::migrate!() embeds the migration files into the binary at compile time, so the running container doesn't need the folder.
The runtime stage
The runtime image gets three things: a system user, the binary, and a default port. useradd --system creates an account with no password and no login shell, and USER linkbox makes the binary run as that account. By default, processes in a container run as root. If someone ever finds a way to make linkbox execute code, a non-root user limits what that code can touch.
EXPOSE 3000 is documentation. It doesn't publish the port; that happens when you run the container.
Keeping things out of the build
Without a .dockerignore, COPY . . sends the whole folder to Docker, including target/, which can be several gigabytes, and .env, which has secrets in it:
target
.env
.git
Dockerfile
compose.yaml
Never let a secret get copied into an image. Anyone who can pull the image can read every file in every layer, even files deleted in a later step.
The result
$ docker images linkbox
linkbox:before 133MB
From a 2.37 GB build image to 133 MB, and most of that is Debian. The binary inside is 11 MB:
$ docker run --rm --entrypoint ls linkbox:before -l /usr/local/bin/linkbox
-rwxr-xr-x 1 root root 10912680 Dec 1 07:45 /usr/local/bin/linkbox
We'll make it smaller later. The before tag is because I'm about to find a problem with it.
Running it with Postgres: Docker Compose
linkbox needs a database next to it. Docker Compose describes several containers that run together in one file, compose.yaml:
services:
db:
image: postgres:18
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}
POSTGRES_DB: linkbox
volumes:
- pgdata:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d linkbox"]
interval: 2s
retries: 15
restart: unless-stopped
app:
build: .
environment:
DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@db:5432/linkbox
CORS_ORIGINS: ${CORS_ORIGINS:-http://localhost:5173}
RUST_LOG: linkbox=info,tower_http=debug
LOG_FORMAT: json
ports:
- "3000:3000"
depends_on:
db:
condition: service_healthy
restart: unless-stopped
volumes:
pgdata:
db is Postgres. Its data lives in a named volume, pgdata, so it survives the container being removed and recreated. With the postgres:18 image, the volume goes at /var/lib/postgresql. Older guides mount /var/lib/postgresql/data, which was right for Postgres 17 and earlier but not for 18, where the image changed its data directory layout.
The health check runs pg_isready every two seconds. app has depends_on with condition: service_healthy, so Compose doesn't start linkbox until Postgres actually accepts connections, not merely until its container has started. Without that, linkbox would often try to connect during Postgres's first few seconds, fail, and exit.
Inside a Compose project, containers reach each other by service name, so the database host in DATABASE_URL is db.
restart: unless-stopped restarts a container if it crashes or the machine reboots, unless you stopped it yourself.
The ${...} values come from your shell environment or a .env file next to compose.yaml. ${POSTGRES_PASSWORD:?message} means the variable is required. Without it:
$ docker compose up -d
Error while interpolating services.db.environment.POSTGRES_PASSWORD: required variable POSTGRES_PASSWORD is missing a value: set POSTGRES_PASSWORD in .env
I'd much rather get that error than a database that started with an empty or default password. ${CORS_ORIGINS:-http://localhost:5173} is the other form: use the variable if it's set, or this default if not.
So .env holds the password, and stays out of git and out of the image:
POSTGRES_PASSWORD=local-dev-only
Then:
$ docker compose up -d
Container linkbox-db-1 Waiting
Container linkbox-db-1 Healthy
Container linkbox-app-1 Starting
Container linkbox-app-1 Started
$ curl localhost:3000/health
{"status":"ok","version":"0.1.0"}
The app ran its migrations against the empty database on startup and started serving.
Why did stopping take ten seconds?
Then I stopped the app container, and timed it:
$ docker stop -t 10 linkbox-app-1
docker stop -t 10 took 10.6s
exit=137
(Docker's default grace period is 10 seconds. My Docker Desktop happened to be configured with a shorter one, so I passed -t 10 to match what you'll most likely see.)
Ten seconds, and exit code 137, which is 128 plus 9: the process was killed with SIGKILL. Here's what happened. docker stop sends the main process a SIGTERM signal, which means "please stop". It waits for the grace period. If the process is still running, Docker sends SIGKILL, which can't be caught or ignored, and the process dies immediately, wherever it was.
So linkbox ignored SIGTERM. On a normal Linux system, a program that doesn't handle SIGTERM gets the default behavior, which is to exit. But inside a container, linkbox is process number 1, and Linux treats PID 1 specially: signals it hasn't set up a handler for are ignored. That rule exists so the init process on a real system can't be killed by accident. In a container, it means any server that doesn't handle SIGTERM itself always waits out the full timeout and then gets killed.
Being killed is worse than slow. If a request is halfway through when SIGKILL arrives, the client gets a dropped connection. Every deploy and every restart does this. Hosting platforms send SIGTERM when they replace your app with a new version, too, so this affects more than docker stop.
Graceful shutdown
Axum supports graceful shutdown directly. You give axum::serve a future that completes when it's time to stop. When it does, the server stops accepting new connections, lets the requests already in progress finish, and then returns.
Here's the future, using tokio::signal and select! from part 9:
use tokio::signal;
/// Resolves when the process is asked to stop: Ctrl+C in a terminal,
/// or SIGTERM from Docker, systemd or a hosting platform.
async fn shutdown_signal() {
let ctrl_c = async {
signal::ctrl_c()
.await
.expect("failed to listen for Ctrl+C");
};
#[cfg(unix)]
let terminate = async {
signal::unix::signal(signal::unix::SignalKind::terminate())
.expect("failed to listen for SIGTERM")
.recv()
.await;
};
#[cfg(not(unix))]
let terminate = std::future::pending::<()>();
tokio::select! {
_ = ctrl_c => {},
_ = terminate => {},
}
tracing::info!("shutdown signal received, finishing in-flight requests");
}
SIGTERM is a Unix concept, so #[cfg(unix)] compiles that branch only on Linux and macOS. On Windows, terminate is a future that never completes, so only Ctrl+C can trigger it. That keeps cargo run working on every platform. select! waits for whichever comes first.
Then in main:
axum::serve(listener, app(AppState::new(pool.clone()), allowed_origins))
.with_graceful_shutdown(shutdown_signal())
.await?;
pool.close().await;
tracing::info!("shut down cleanly");
Ok(())
After the server returns, pool.close() closes the database connections properly instead of letting them drop when the process exits. Postgres doesn't mind either way, but a clean close means no "connection reset" noise in its logs.
Same test, after rebuilding:
$ docker stop -t 10 linkbox-app-1
docker stop -t 10 took 0.6s
exit=0
{"timestamp":"2026-12-01T07:48:35.183529Z","level":"INFO","fields":{"message":"shutdown signal received, finishing in-flight requests"},"target":"linkbox"}
{"timestamp":"2026-12-01T07:48:35.183809Z","level":"INFO","fields":{"message":"shut down cleanly"},"target":"linkbox"}
Under a second, exit code 0, and a log line saying so. If requests had been in progress, the server would have waited for them first.
One thing to keep in mind: graceful shutdown waits for in-flight requests, but the platform only waits for its grace period. linkbox has a 10-second request timeout from part 11, and Docker's default grace period is also 10 seconds. A request that started just before shutdown could in theory still be running when the grace period ends. Keep your request timeout comfortably shorter than the grace period, or raise the grace period (Compose has stop_grace_period for that).
Configuration from the environment
A deployed app should get all of its settings from environment variables, so the same image runs on your laptop, in CI and in production with different values. linkbox already read DATABASE_URL and CORS_ORIGINS. Two more were missing.
The port was hard-coded to 3000. Most platforms tell your app which port to listen on with a PORT variable:
let port = std::env::var("PORT").unwrap_or_else(|_| "3000".into());
let listener = tokio::net::TcpListener::bind(format!("0.0.0.0:{port}"))
.await
.with_context(|| format!("could not listen on port {port}"))?;
0.0.0.0 means every network interface. Binding to 127.0.0.1 would only accept connections from inside the container itself, and the app would be unreachable. It's one of the most common reasons a containerized server "works locally" and not in Docker.
with_context is context from part 5's anyhow section, but it takes a closure, so the message is only built if there's an error.
The other missing piece was the log format. The pretty, colored logs from tracing-subscriber are great in a terminal. In production, logs go to a platform that collects, searches and filters them, and those work best with JSON, one object per line. tracing-subscriber supports that with its json feature:
tracing-subscriber = { version = "0.3.23", features = ["env-filter", "json"] }
/// Human-readable logs by default, JSON when LOG_FORMAT=json.
fn init_tracing() {
let filter = EnvFilter::try_from_default_env()
.unwrap_or_else(|_| EnvFilter::new("linkbox=debug,tower_http=debug"));
if std::env::var("LOG_FORMAT").as_deref() == Ok("json") {
tracing_subscriber::fmt()
.json()
.with_env_filter(filter)
.init();
} else {
tracing_subscriber::fmt().with_env_filter(filter).init();
}
}
as_deref() turns Result<String, _> into Result<&str, _>, so it can be compared with Ok("json"). Here's creating a link through the container, as JSON logs:
{"timestamp":"2026-12-01T07:50:48.257804Z","level":"INFO","fields":{"message":"link created","id":1,"user_id":1},"target":"linkbox::routes::links","span":{"method":"POST","uri":"/links","version":"HTTP/1.1","name":"request"},"spans":[{"method":"POST","uri":"/links","version":"HTTP/1.1","name":"request"}]}
{"timestamp":"2026-12-01T07:50:48.257872Z","level":"DEBUG","fields":{"message":"finished processing request","latency":"11 ms","status":201},"target":"tower_http::trace::on_response","span":{"method":"POST","uri":"/links","version":"HTTP/1.1","name":"request"},"spans":[{"method":"POST","uri":"/links","version":"HTTP/1.1","name":"request"}]}
This is where the structured fields from part 11 pay off. id and user_id from tracing::info!(id = link.id, user_id = user.id, "link created") are real JSON fields, and the request's method and URI are attached from the TraceLayer span. In a log platform, "every link Ana created" or "every response slower than 500 ms" become simple queries instead of text searches.
tower_http=debug in RUST_LOG is what turns on the per-request lines, because TraceLayer logs at the debug level by default. On a busy server you might set it to info and rely on metrics instead.
A smaller, faster binary
Cargo's release profile has a few settings that are off by default because they make compiling slower. For a binary you build once and run for weeks, that's often a good trade. In Cargo.toml:
[profile.release]
strip = true
lto = "thin"
codegen-units = 1
strip = true removes debugging symbols from the binary. lto = "thin" turns on link-time optimization, which lets the compiler optimize across crate boundaries, inlining a function from one crate into another, for example. codegen-units = 1 compiles each crate as one unit instead of splitting it up to compile in parallel, which gives the optimizer a complete view.
With the shutdown handling and JSON logging added, the binary had grown slightly, to 11,150,824 bytes. With these settings, it went down to 6,454,376, a little over 40% smaller:
-rwxr-xr-x 1 root root 6454376 Dec 1 07:50 /usr/local/bin/linkbox
The image went from 133 MB to 127 MB, because the binary was never the big part. The base image is.
The cost is build time. The step that compiles linkbox itself went from about 9 seconds to 24.8. And strip = true has a real downside: if the app panics, the backtrace no longer has function names in it, which makes production panics harder to debug. strip = "debuginfo" is a middle ground that removes the bulky debug information but keeps the symbol names. If I were running linkbox for real, that's the one I'd pick.
If you want the image itself much smaller, the next step is a runtime base with less in it, like Google's distroless images, or building a fully static binary against musl and running it in an empty scratch image. Both work with Rust, and both are more fiddly than what's here. For most apps, 127 MB is fine.
Checking the whole thing
With all the changes in, I rebuilt and ran the full flow against the containers:
$ docker exec linkbox-app-1 id
uid=10001(linkbox) gid=999(linkbox) groups=999(linkbox)
$ curl -X POST localhost:3000/auth/register ...
{"id":1,"email":"ana@example.com","created_at":"2026-12-01T07:50:47.759750Z"}
$ curl -X POST localhost:3000/links -H "authorization: Bearer ..." ...
{"id":1,"url":"https://www.rust-lang.org","title":"Rust","tags":[],"created_at":"2026-12-01T07:50:48.255426Z"}
The app runs as the linkbox user, not root. Then I removed everything and started it again:
$ docker compose down
Container linkbox-db-1 Removed
Network linkbox_default Removing
Network linkbox_default Removed
$ docker compose up -d
Container linkbox-app-1 Started
$ curl localhost:3000/links
[{"id":1,"url":"https://www.rust-lang.org","title":"Rust","tags":[],"created_at":"2026-12-01T07:50:48.255426Z"}]
$ curl localhost:3000/auth/me -H "authorization: Bearer ..."
{"id":1,"email":"ana@example.com","created_at":"2026-12-01T07:50:47.759750Z"}
docker compose down removes the containers and the network but keeps named volumes, so the link, the user and even Ana's session survived. (docker compose down -v deletes the volumes too, along with all your data. Be careful with that -v.)
Where to host it
Everything up to here, I ran and measured. This section is different. Each hosting option needs its own account, prices and free tiers change often, and their command-line tools change between versions. So I'll describe how linkbox fits each one, and point you at their current documentation for the exact steps, rather than show outputs that would be out of date by the time you read this.
The good news is that the work is done. Anything that can run a Docker image and give it a DATABASE_URL can run linkbox.
A virtual private server
A VPS is a Linux machine you rent by the month from a provider like Hetzner, DigitalOcean or Linode. You install Docker, copy compose.yaml and the project over (or build the image in CI and pull it), create .env, and run docker compose up -d. It's the cheapest option for a small app and you control everything.
You also handle everything: operating system updates, the firewall, backups, and HTTPS. For HTTPS, the easiest route I know is Caddy, a web server that gets and renews certificates from Let's Encrypt automatically. You add it as another service in compose.yaml and give it a two-line config:
api.example.com {
reverse_proxy app:3000
}
Point your domain's DNS at the server, and Caddy handles the certificate. Then remove the ports section from the app service, so the only way in is through Caddy on ports 80 and 443. You'd want to stop publishing the database port too, and in this compose.yaml it already isn't.
Fly.io
Fly runs your Docker image as small virtual machines, in whichever regions you choose. Its CLI (fly launch) detects the Dockerfile and creates a fly.toml config for you. The settings that matter for linkbox are the internal port (3000, or whatever you set PORT to) and an HTTP health check on /health, which Fly uses to decide whether a new version is ready before sending it traffic. Secrets like DATABASE_URL are set with fly secrets set, so they never appear in your config file. Fly also offers managed Postgres, or you can point DATABASE_URL at any Postgres you already have.
Railway
Railway connects to your GitHub repository, notices the Dockerfile, and builds and deploys on every push. You add a PostgreSQL database to the project from its dashboard, and reference its connection string as DATABASE_URL in your app's variables. Railway sets PORT for you, which is one reason the PORT support above matters.
Others
Render works much like Railway. Google Cloud Run and AWS App Runner run containers and scale them, including down to zero when nobody's using the app, at the cost of a slower first request. Shuttle is a platform built specifically for Rust, with its own way of provisioning databases from your code.
Whichever you choose, two of our choices make the move easier: the app reads everything from environment variables, and it shuts down cleanly when the platform asks.
Before you call it production
linkbox is deployable now. Here's what I'd still want before trusting it with other people's data.
Back up the database. A volume is not a backup. A daily pg_dump to storage somewhere else is the minimum, and you should try restoring from it at least once, because a backup you've never restored is a hope, not a backup. Managed Postgres services handle this for you, which is a big part of what you pay them for.
Set CORS_ORIGINS to your real frontend's origin, and generate a long random POSTGRES_PASSWORD instead of local-dev-only.
Think about connections if you run more than one copy. Each instance of linkbox opens up to 10 connections (from the pool settings in part 12), and Postgres allows 100 by default. Ten instances would use all of them.
Migrations run at startup, which is convenient. When several instances start at once, SQLx takes a Postgres advisory lock while migrating, so only one runs the migrations and the others wait. What startup migrations don't protect you from is a migration that breaks the old version of the app still running during a deploy. Dropping or renaming a column the old code uses is the classic example. The safe pattern is to make changes in steps: add the new column, deploy code that uses it, and only drop the old one in a later release.
Add rate limiting to the login and register routes, as part 13 suggested. Watch the /health endpoint with an uptime monitor, so you hear about problems before your users do. And keep dependencies current: cargo update for compatible updates, and cargo audit (installed with cargo install cargo-audit) to check them against the RustSec database of known vulnerabilities.
Node and Rust deployment compared
| Node | Rust |
|---|---|
Ship code, node_modules and a Node runtime |
Ship one binary |
FROM node:24-slim and npm ci in the image |
Build stage with rust, runtime stage with debian:*-slim |
Copy package.json first to cache npm ci |
Build a fake main.rs first to cache dependencies |
| Type errors and bad queries found at runtime | SQLX_OFFLINE build fails if queries don't match .sqlx |
process.on("SIGTERM", ...) then server.close() |
with_graceful_shutdown(shutdown_signal()) |
pino for JSON logs |
tracing-subscriber with the json feature |
| Typical image a few hundred MB | 127 MB here, much less on distroless or scratch |
| Memory use measured in tens of MB at idle | A few MB at idle, as we measured in part 10 |
The signal handling row deserves a note: Node has the same PID 1 problem. A Node server run directly as a container's main process also ignores SIGTERM unless it handles it. That's why you see --init or tini in a lot of Node Dockerfiles. With Rust, there's no reason to add either, since the app handles the signal itself.
Exercises
- Add a
HEALTHCHECKto the Dockerfile.debian:trixie-slimhas nocurl, so you'll need to either install it (and accept a bigger image), or add a--healthflag to the linkbox binary that calls/healthitself and exits with 0 or 1. Which do you prefer, and why? - Add a slow route (
tokio::time::sleepfor 5 seconds), start a request to it, and rundocker stopwhile it's in progress. Does the request finish? Now try it with a 15-second sleep and the default grace period. - Change
strip = truetostrip = "debuginfo". How big is the binary now? Add a route that panics, call it, and compare the backtraces from both builds withRUST_BACKTRACE=1. - Add a Caddy service to
compose.yamland serve linkbox athttps://localhost. (Caddy uses its own local certificate authority forlocalhost, so you won't need a real domain.) - Write a small
backupservice forcompose.yaml, or a shell script, that runspg_dumpagainst thedbcontainer and writes a dated file. Then restore it into a fresh database and check that your links are there. - Build linkbox for
x86_64-unknown-linux-musland run it in aFROM scratchimage. What breaks, and what do you have to add to make HTTPS connections to other services work? (Hint: certificates.)
Where to go from here
That's the series. If you started at part 1, you've installed Rust, worked through ownership and borrowing, modeled data with structs, enums and traits, handled errors with Result, written async code with Tokio, and built a web API with authentication, a real database, tests, and a Docker image. That's not a toy. It's the same shape as plenty of production services.
Some things I skipped, or only touched, that are worth learning next.
Lifetimes, properly. We used them when the compiler asked and mostly avoided them by owning data. When you start writing functions that return references into their arguments, or structs that hold references, you'll need the full picture. Chapter 10 of The Rust Programming Language covers it well.
Traits in more depth: trait objects (dyn Trait), generic bounds, and how Axum's extractors use them. Reading how FromRequestParts is implemented for Path is a good exercise once you're comfortable.
Observability beyond logs: metrics and traces with OpenTelemetry, which tracing connects to.
For a book-length version of what this series did, "Zero To Production In Rust" by Luca Palmieri builds a complete production API in Rust with much more depth on testing, deployment and design. And the examples folder in the Axum repository on GitHub has a small working project for nearly every feature, which is where I go first when I need to do something new with Axum.
The most useful next step, though, is to build something of your own. Take the linkbox structure and make it into whatever you need. You'll fight the borrow checker less than you did in part 3, and when you do, you'll understand what it's telling you.
If you want the bigger picture of how Axum compares with the other Rust web frameworks, the companion post Rust web frameworks compared covers Actix Web, Rocket, Poem and others.
Thanks for reading the whole thing.