All posts

PostgreSQL in Practice #5 VACUUM and autovacuum: How Dead-Tuple Cleanup Works, and Tuning It
4 min read

PostgreSQL in Practice #5 VACUUM and autovacuum: How Dead-Tuple Cleanup Works, and Tuning It

VACUUM sits at the center of PostgreSQL operational knowledge. The dead tuples MVCC leaves behind and VACUUM's three jobs (marking space reusable, refreshing the visibility map, preventing transaction ID wraparound), why autovacuum is usually enough and where its default thresholds fail (bigger tables get cleaned later), per-table scale factor tuning, the long-running transactions that block cleanup, bloat inspection queries, and why VACUUM FULL is dangerous.

Rust in Practice #5 Parallelism with rayon: Map-Reduce Without Data Races
4 min read

Rust in Practice #5 Parallelism with rayon: Map-Reduce Without Data Races

Spreading the aggregation across cores. When parallelism pays off (CPU-bound work) and why the strategy switches from streaming to whole-file reads, per-thread partial aggregates with rayon's par_lines plus fold and reduce, why sharing one HashMap behind a Mutex gets slower (lock contention), and the moment the compiler catches a shared-mutable-state mistake.

SRE in Practice #3 Alert Design: Symptom-Based Alerting and Multiwindow Burn Rates
4 min read

SRE in Practice #3 Alert Design: Symptom-Based Alerting and Multiwindow Burn Rates

Designing alerting so that only pages worth waking a human survive: why to move from cause-based alerts (high CPU) to symptom-based alerts (user requests failing), the criterion that separates pages from tickets, building burn-rate alerts as combinations of short and long windows to cut both false positives and false negatives, and the operating routine that measures and reduces alert fatigue.

Terraform Basics #6 Dependencies and Repetition: depends_on, count vs for_each, and dynamic Blocks
5 min read

Terraform Basics #6 Dependencies and Repetition: depends_on, count vs for_each, and dynamic Blocks

How references double as dependencies that decide creation order, and the exceptional cases where depends_on is needed. We cover the notorious recreation trap that removing an item from the middle of a list triggers with count, the key-based safety of for_each and how to choose between the two, and dynamic blocks for repeating nested blocks.

PostgreSQL in Practice #4 Advanced Index Strategy: Partial, Composite, Covering — and GIN, BRIN
4 min read

PostgreSQL in Practice #4 Advanced Index Strategy: Partial, Composite, Covering — and GIN, BRIN

Building strategy on top of basics chapter 4's B-tree fundamentals: partial indexes that bake a WHERE condition into the index, covering indexes (INCLUDE) and the conditions for an Index Only Scan, choosing beyond B-tree (GIN, GiST, BRIN), finding unused indexes with pg_stat_user_indexes and cleaning them up, and index bloat with REINDEX CONCURRENTLY.

Rust in Practice #4 Iterators at Work: Aggregation, Top-N, and the Release Build Difference
4 min read

Rust in Practice #4 Iterators at Work: Aggregation, Top-N, and the Release Build Difference

Stacking analysis on the parser: an aggregation structure that counts failures while streaming successes, status code distribution via HashMap entry, top-N by sorting, the completion of the stats and top commands, and measuring debug vs release with Instant — why the gap runs to dozens of times, and why release is not the default.

SRE in Practice #2 Operating the Error Budget: The Policy Document and Burn Rates
5 min read

SRE in Practice #2 Operating the Error Budget: The Policy Document and Burn Rates

Turning the error budget from a concept into an operating tool: the error budget policy document that agrees on actions before the incident, the executive sign-off that makes feature freezes actually work, calculating the burn rate that expresses how fast the budget is being consumed, responding differently to fast burns and slow burns, and the practical patterns that wire the budget into release decisions.

Terraform Basics #5 State Explained: The tfstate File Structure and How plan Computes Changes
5 min read

Terraform Basics #5 State Explained: The tfstate File Structure and How plan Computes Changes

Opening the terraform.tfstate file to examine its structure, and explaining how plan computes changes by comparing three things: code, state, and the real infrastructure. We also cover the problem of sensitive values stored in plaintext and the rule against committing state, manipulation commands like state list, show, mv, and rm, and what happens when you lose your state.

PostgreSQL in Practice #3 The Performance Diagnostics Routine: Finding Slow Queries with pg_stat_statements
4 min read

PostgreSQL in Practice #3 The Performance Diagnostics Routine: Finding Slow Queries with pg_stat_statements

A standard routine from "the database is slow" to the culprit query. pg_stat_activity for what is happening right now (active queries, waits, long-running transactions), installing pg_stat_statements and its key columns (total_exec_time, mean_exec_time, calls) for finding expensive queries in cumulative statistics, why top-by-total and top-by-mean point at different culprits, configuring the slow query log (log_min_duration_statement), and the handoff to EXPLAIN.

Rust in Practice #3 File IO and Parsing: Read with BufReader, Turn a Log Line into a Struct
5 min read

Rust in Practice #3 File IO and Parsing: Read with BufReader, Turn a Log Line into a Struct

Two fundamentals for handling large files: choosing between read_to_string (whole file in memory) and BufReader streaming, and how buffering relates to system calls. Then the parser that turns an access-log line into a LogEntry struct — quote handling, status code conversion, Part 2's ParseError in action — and the serde extension that accepts JSON Lines logs.

SRE in Practice #1 Designing SLIs and SLOs: What to Measure and How Many Nines to Promise
5 min read

SRE in Practice #1 Designing SLIs and SLOs: What to Measure and How Many Nines to Promise

First post in the SRE in Practice series, on actually designing SLIs and SLOs: picking what to measure from user journeys, why good SLIs take the good/total ratio form, the trade-offs between measuring at the load balancer, the server, or the client, why SLO targets must start from current performance rather than aspiration, choosing the measurement window, and what an SLO specification document must contain.

Terraform Basics #4 Data Sources and Expressions: Reading Instead of Creating, Conditionals, and for
5 min read

Terraform Basics #4 Data Sources and Expressions: Reading Instead of Creating, Conditionals, and for

Covering the data block that reads information from existing resources Terraform did not create, using a latest-AMI lookup as the example, then building per-environment branches with conditionals and transforming lists and maps with for expressions and splat syntax. We also go through the built-in functions you will use most and terraform console, the playground for trying expressions.