All posts

PostgreSQL in Practice #2 Connection Pooling: The max_connections Misconception and PgBouncer
4 min read

PostgreSQL in Practice #2 Connection Pooling: The max_connections Misconception and PgBouncer

The connection problem every growing service hits. Why a PostgreSQL connection is expensive (each is a process), why raising max_connections is not the answer (too many connections actually lower throughput), the division of labor between application pools and external poolers like PgBouncer, what PgBouncer transaction mode buys and what it forbids (session-state features), and a working sense of pool sizing.

Rust in Practice #2 Error Design: anyhow and thiserror, Engineering How It Dies
4 min read

Rust in Practice #2 Error Design: anyhow and thiserror, Engineering How It Dies

In a CLI tool, error messages are part of the user interface. The division of labor between anyhow — the default for the application layer, with main returning anyhow::Result and context stacking up the story — and thiserror, which builds concrete error types callers can branch on. The criterion for choosing between them, plus exit codes: designing every error path in loglens.

Terraform Basics #3 Variables, Outputs, and Locals: Three Tools for Removing Hardcoded Values
5 min read

Terraform Basics #3 Variables, Outputs, and Locals: Three Tools for Removing Hardcoded Values

How to pull values out of your code with variable blocks, and the precedence among the four input paths — tfvars files, the -var-file and -var flags, and environment variables. We block bad values at the door with validation, expose results with output, and name internal computations with locals, laying the groundwork for building multiple environments from the same code.

What's New in Python 3.14: t-strings, Deferred Annotations, Official Free-Threading
5 min read

What's New in Python 3.14: t-strings, Deferred Annotations, Official Free-Threading

The practical changes in Python 3.14, released October 2025: t-strings that look like f-strings but produce template objects, deferred annotation evaluation becoming the default, what the free-threaded (no-GIL) build losing its experimental label means, multiple interpreters and Zstandard compression landing in the standard library, parenthesis-free except syntax, and the remote debugging interface — everything worth knowing before upgrading.

Deploying Python Web Apps to Production: gunicorn, uvicorn, systemd, Docker
5 min read

Deploying Python Web Apps to Production: gunicorn, uvicorn, systemd, Docker

From why the development server must never serve production traffic to the standard deployment stack: the WSGI and ASGI split, combining gunicorn with uvicorn workers, how to choose a worker count, managing the process with a systemd service, what the nginx reverse proxy is actually for, the basic shape of a Docker deployment, logs to stdout, health checks, and graceful shutdown — as a checklist.

PostgreSQL in Practice #1 Schema Migrations: Changing Tables Without Stopping the Service
4 min read

PostgreSQL in Practice #1 Schema Migrations: Changing Tables Without Stopping the Service

The practice series opens with the craft of changing tables that are live in production. Why migrations must be managed as code (ordering and reproducibility), PostgreSQL's strength of transactional DDL, telling dangerous changes from safe ones by lock strength and duration, splitting NOT NULL into stages, CREATE INDEX CONCURRENTLY, and solving column renames and type changes with the expand-contract strategy.

Rust in Practice #1 Project Design and clap: Structuring a Subcommand CLI
4 min read

Rust in Practice #1 Project Design and clap: Structuring a Subcommand CLI

An eight-part practice course that turns the grammar from the basics course into a real tool. We build loglens, an access-log analysis CLI. Why CLI tools are Rust's signature stage (single binary, startup speed), declaring subcommands (stats, top, errors) as one enum with clap's derive style, the auto-generated --help, and the design map for all eight parts.

Terraform Basics #2 HCL Core Syntax: Blocks, Arguments, Resource Addresses, and the Three Shapes of Change
5 min read

Terraform Basics #2 HCL Core Syntax: Blocks, Arguments, Resource Addresses, and the Three Shapes of Change

A look at the skeleton of HCL — blocks and arguments — what a resource address like aws_s3_bucket.hello actually means, and the syntax for referencing one resource from another. We read the symbols in plan output to tell apart the three shapes of change — create, update, replace — and build the habit of running fmt and validate before every commit.

Async Task Processing in Python with Celery: Queues, Workers, and an Ops Checklist
5 min read

Async Task Processing in Python with Celery: Queues, Workers, and an Ops Checklist

How to move work that never belonged inside a web request into Celery: the task-queue architecture of broker, worker, and result backend, defining tasks and calling delay, configuring retries with exponential backoff, the idempotency principle that follows from at-least-once delivery, operational settings like acks_late and time limits, monitoring with Flower, and when FastAPI BackgroundTasks or RQ is all you actually need.

PostgreSQL Basics #9 Roles, Permissions, Backup Fundamentals: The Minimum Discipline of Operations
4 min read

PostgreSQL Basics #9 Roles, Permissions, Backup Fundamentals: The Minimum Discipline of Operations

Closing out the basics with the minimum operational discipline. The PostgreSQL permission model that unifies users and groups into a single role concept, the practical sequence for creating a least-privilege account instead of handing the application a superuser (GRANT and default privileges), the public schema caveat, logical backups with pg_dump and pg_restore and why restore rehearsals matter, plus a retrospective of the nine basics and a preview of the practice series.

Rust Basics #9 Lifetimes and Modules: When Lifetime Annotations Are Needed, Finishing with Crates
5 min read

Rust Basics #9 Lifetimes and Modules: When Lifetime Annotations Are Needed, Finishing with Crates

The final part of the basics course. How Part 4's dangling-reference blocking actually worked, explained through lifetimes: the moment missing lifetime specifier appears, what the annotation really means (declaring a relationship, not extending a life), and why it is usually elided. Then the module system with mod and pub, using external crates from crates.io, and the learning path after this course.

Terraform Basics #1 IaC and Terraform: Where Console Clicking Breaks Down, Installation, and the First apply
8 min read

Terraform Basics #1 IaC and Terraform: Where Console Clicking Breaks Down, Installation, and the First apply

Tracing how infrastructure built by clicking through the console falls apart — no reproducibility, no history, no review — and how declaring the desired state as code solves each of those problems. We compare where Terraform sits among CloudFormation, CDK, and Pulumi, then walk through installation and a first full cycle: creating an S3 bucket with init, plan, and apply, and removing it with destroy.