schoolofweb .net

An IT learning blog for studying programming and infrastructure in order, from basics to real practice.

91 series · 866 posts · 4 books

Latest Posts

PostgreSQL in Practice #7 Partitioning: Splitting Giant Tables by Time
4 min read

PostgreSQL in Practice #7 Partitioning: Splitting Giant Tables by Time

Declarative partitioning, the standard prescription for tables in the hundreds of millions of rows. What partitioning actually solves (deleting old data becomes a single DROP, partition pruning, spreading the VACUUM burden) and what it does not, the RANGE syntax for monthly tables, the constraint that the partition key must be part of the primary key, what query conditions enable pruning, the operational duty of creating future partitions and pg_partman, and the criteria for when to adopt it.

Rust in Practice #7 Release Optimization and Cross-Compilation: Small, Fast Binaries That Run Anywhere
4 min read

Rust in Practice #7 Release Optimization and Cross-Compilation: Small, Fast Binaries That Run Anywhere

The first half of shipping. Tightening [profile.release] (lto, codegen-units, strip) and what each option trades away, why panic = "abort" should not be flipped casually, how binary size shrinks, and cross-compilation with rustup target — especially the musl static-link build that removes the glibc dependency and runs on old servers, plus the cross tool that detours linker problems through Docker.

SRE in Practice #5 Postmortems: Blameless Reviews and Keeping Action Items Alive
5 min read

SRE in Practice #5 Postmortems: Blameless Reviews and Keeping Action Items Alive

Turning incidents into organizational learning: why blamelessness is an information-gathering strategy rather than kindness, trigger criteria for which incidents get a postmortem, the template running from timeline through impact and root-cause analysis to action items, the questioning method that refuses to stop at human error and digs down to system causes, and the tracking rules that keep action items from rotting in the backlog.

Terraform Basics #8 Module Basics: Reusing Resource Bundles and Registry Modules
5 min read

Terraform Basics #8 Module Basics: Reusing Resource Bundles and Registry Modules

Starting from the fact that every Terraform directory is already a module, we build a child module that takes variables as inputs and outputs as results, and call it with a module block. We also cover pulling battle-tested modules from the registry with version pinning, plus the criteria for splitting modules and where over-splitting begins.

PostgreSQL in Practice #6 Locks and Concurrency: Deadlocks, DDL Locks, SKIP LOCKED
4 min read

PostgreSQL in Practice #6 Locks and Concurrency: Deadlocks, DDL Locks, SKIP LOCKED

The territory MVCC does not solve: locking. The two layers of row locks (write-vs-write conflicts) and table locks (DDL), tracing lock waits with pg_locks and pg_blocking_pids, the structure that produces deadlocks (cross-order updates) and the prevention rule (always lock in the same order), making read-decide-write safe with SELECT FOR UPDATE, and the standard work-queue pattern FOR UPDATE SKIP LOCKED.

Rust in Practice #6 Testing: From Parser Unit Tests to CLI Integration Tests
4 min read

Rust in Practice #6 Testing: From Parser Unit Tests to CLI Integration Tests

Wrapping loglens in a safety net. #[cfg(test)] unit tests living next to the code (the parser's normal, boundary, and failure cases), integration tests in the tests/ directory, CLI tests that run the built binary and verify output and exit codes with assert_cmd and predicates, temporary log files via tempfile, and what it means that cargo test runs tests in parallel.

SRE in Practice #4 On-Call Operations: Rotations, Escalation, Load Management
5 min read

SRE in Practice #4 On-Call Operations: Rotations, Escalation, Load Management

Designing an on-call system that people can sustain: the minimum headcount that makes a rotation viable and the shift structures, the escalation chain for when the primary responder is stuck, the handoff routine between shifts, why pages-per-shift needs a measured ceiling, securing follow-up time to pay down what on-call uncovers, and the compensation and culture without which none of it lasts.

Terraform Basics #7 Resource Lifecycle Control: Replacement Conditions, create_before_destroy, prevent_destroy
5 min read

Terraform Basics #7 Resource Lifecycle Control: Replacement Conditions, create_before_destroy, prevent_destroy

How to read from a plan which attribute changes end as an update and which ones force a resource replacement. We cover create_before_destroy, which flips the replacement order to reduce downtime, prevent_destroy, which blocks deletion of production resources, ignore_changes, which tolerates changes made outside the code, and forcing a replacement with the -replace flag.