Infrastructure
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.
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
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.
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.
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.
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.
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.
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.
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.
PostgreSQL Basics #8 Views, CTEs, Window Functions: Keeping Complex Queries Readable
Three tools for structuring queries that have outgrown one screen: views that give a repeated query a name and materialized views as their physical-copy sibling, WITH clauses (CTEs) that let a query read top to bottom, the basic anatomy of window functions (OVER, PARTITION BY) and the canonical ROW_NUMBER pattern for top-N per group, how window functions differ from aggregates (rows are not collapsed), and LAG for month-over-month comparisons.
PostgreSQL Basics #7 JSONB: Schema Flexibility Inside a Relational Database
JSONB is what let PostgreSQL reach into NoSQL territory. The difference between json and jsonb (and why jsonb is the default), the extraction operators (->, ->>, #>>) and the existence and containment operators (?, @>), the GIN index that backs JSONB search, the nature of updates (jsonb_set), and most importantly the design boundary of what stays a column and what goes into JSONB.
PostgreSQL Basics #6 Transactions and MVCC: The Fundamentals of Concurrency
How PostgreSQL preserves consistency when many connections touch the same data at once. The basics of BEGIN, COMMIT, and ROLLBACK and atomicity, the core of MVCC (multi-version concurrency control) — readers never block writers — the fact that UPDATE actually creates a new row version and the dead tuples that foreshadows, what the default Read Committed isolation level means and its trap, and when to raise to Repeatable Read or Serializable.