All posts.
Every EasySpawn article, newest first — deploying AI-built apps, Claude Code, databases, security, and the infrastructure underneath.
822 posts · page 13 of 34
Postgres Timeouts: statement_timeout, lock_timeout and Friends
Postgres ships with every timeout disabled, so a stuck query or forgotten transaction can hold locks forever. What statement_timeout, lock_timeout, idle_in_transaction_session_timeout, transaction_timeout and idle_session_timeout do, the lock-queue outage they prevent, safe values, and where to set them.
Postgres Roles and Permissions: CREATE USER, GRANT, and Least Privilege
Most apps connect to Postgres as a superuser, so one SQL injection or rogue AI command can drop everything. How Postgres roles, privileges, schemas and default privileges work, and a practical setup with separate owner, app and read-only roles.
Postgres "ERROR: relation does not exist": Causes and Fixes
Postgres can't find the table you named. The usual causes — migrations not run, connected to the wrong database, uppercase names and double quotes, the table is in a different schema, or permissions — and how to check each with psql.
Postgres Read Replicas: Streaming Replication, Lag, and Read-Your-Writes
How Postgres physical streaming replication works, sync vs async, measuring replication lag, query conflicts and hot_standby_feedback, routing reads in your app without breaking read-your-writes, replication slots that fill disks, and when a replica is the wrong fix.
Postgres Planner Statistics: Why the Query Plan Is Wrong
Postgres picks query plans from statistics about your data. When they're stale or too coarse, row estimates are off by orders of magnitude and the planner chooses a terrible plan. How ANALYZE samples tables, reading pg_stats, default_statistics_target, correlated columns and CREATE STATISTICS, and fixing misestimates.
Postgres "password authentication failed for user": How to Fix It
Postgres rejected the username or password your app sent. The real causes — wrong password in the connection string, special characters not URL-encoded, a Docker volume that kept an old password, the wrong user or host, pg_hba.conf rules — and how to reset the password safely.
Postgres MVCC Explained: Tuples, xmin/xmax, Snapshots and Why VACUUM Exists
How PostgreSQL lets readers and writers work without blocking each other: every UPDATE writes a new row version, transactions see a snapshot, and visibility is decided by xmin and xmax. See it with real queries, and how it explains bloat, VACUUM, HOT updates, long transactions and wraparound.
Postgres Memory Tuning: shared_buffers, work_mem and the Rest
Postgres's memory settings are conservative by default and easy to get dangerously wrong. How shared_buffers and the OS page cache work together, why work_mem is per operation not per query, maintenance_work_mem, effective_cache_size, huge pages, and worked settings for 4, 8 and 16 GB servers.
Postgres Materialized Views: Fast Reports Without Slowing Your App
A view is a saved query; a materialized view also saves the result. When materialized views make dashboards and reports fast, REFRESH vs REFRESH CONCURRENTLY, indexing them, scheduling refreshes with pg_cron or your job runner, staleness, and alternatives like summary tables.
Postgres Index Types: B-tree, GIN, GiST, BRIN, Hash — and When Each Wins
Postgres has more index types than most databases, and choosing well can turn a sequential scan into milliseconds. How B-tree, GIN, GiST, SP-GiST, BRIN and hash indexes work, which operators each supports, partial and expression indexes, covering indexes, and how to verify the planner uses them.
Postgres HOT Updates and Fillfactor: Cheaper UPDATEs
Every Postgres UPDATE writes a new row version — and normally new entries in every index. Heap-only tuple (HOT) updates skip the index work. When HOT applies, why indexed columns and full pages prevent it, tuning fillfactor, measuring the HOT ratio, and designing hot tables to stay HOT.
Postgres CTEs (WITH Queries): Readable SQL, Recursion and Data-Modifying CTEs
Common table expressions let you name subqueries and build complex SQL step by step. Basic WITH queries, recursive CTEs for trees and hierarchies, data-modifying CTEs that insert or delete and return rows, MATERIALIZED vs NOT MATERIALIZED, and when a CTE affects performance.
Change Data Capture in Postgres: Streaming Every Row Change
Change data capture streams every insert, update and delete out of Postgres as it happens. How logical decoding and replication slots work, publications and pgoutput, REPLICA IDENTITY, Debezium and lighter alternatives, the outbox pattern, and the operational traps — retained WAL, schema changes and failover.
Playwright Tutorial: End-to-End Tests That Aren't Flaky
Playwright drives real browsers to test your app the way users use it. Install it, write your first test, use role-based locators and auto-waiting assertions, log in once and reuse the session, run against a dev server, debug with UI mode and traces, and run it in CI.
Playwright MCP: Let Claude Code Use a Real Browser
The Playwright MCP server lets AI tools open pages, click, type and read a live browser through accessibility snapshots instead of screenshots. How to add it to Claude Code, useful prompts for testing and debugging, key options like headless and isolated, and its limits.
pip "error: externally-managed-environment": What It Means and How to Fix It
Newer Linux distributions and Homebrew stop pip from installing packages into the system Python, to protect the operating system. Why it happens, and the right fixes: a virtual environment, uv, or pipx for tools — and why --break-system-packages is a last resort.
PID 1 in Containers: Signals, Zombies, and Why Your Container Won't Stop
Inside a container your app is PID 1, and PID 1 is special: the kernel won't apply default signal handlers to it and it must reap orphaned children. Why docker stop takes 10 seconds, why shell-form CMD swallows SIGTERM, zombies, and the fixes: exec form, tini/--init, signal handling.
pg_stat_statements: Find the Queries Slowing Down Your Postgres
pg_stat_statements records statistics for every distinct query your database runs — calls, total and mean time, rows, cache hits. How to enable it, the queries to find what costs the most, interpreting the results, resetting, and turning findings into indexes and fixes.
"Command Not Found": The PATH Variable Explained
"command not found" or "is not recognized as an internal or external command" usually means the program is installed but your terminal doesn't know where to look. How PATH works on Mac, Linux and Windows, how to check it, and how to add a folder permanently.
What Are Passkeys? Passwordless Login Explained
Passkeys replace passwords with a key pair stored on your device and unlocked with your fingerprint, face or PIN. How they work, why they can't be phished or leaked from a database, syncing across devices, and what adding passkey login to your own app involves.
Pair Programming With AI: How to Work With an AI as Your Partner
Pair programming means two people on one problem — a driver and a navigator. With AI, you can take either role. When to let the AI drive and when to drive yourself, a workflow that keeps you in control, prompts for each role, and the habits that make you better, not lazier.
What Is package-lock.json? (And Should You Commit It?)
package.json says which versions your app accepts; package-lock.json records exactly which versions were installed. Why the lock file exists, why you should commit it, npm install vs npm ci, fixing merge conflicts in it, and the equivalent files for pnpm, Yarn and Bun.
Optimistic vs Pessimistic Locking: Preventing Lost Updates
Two users edit the same record and one silently overwrites the other. Pessimistic locking (SELECT FOR UPDATE) blocks the second writer; optimistic locking (a version column) detects the conflict. How each works, code for both, atomic updates that avoid locks entirely, and how to choose.
OpenAPI vs Swagger: What's the Difference?
OpenAPI is the specification for describing HTTP APIs; Swagger is the original name and a set of tools (Swagger UI, Editor, Codegen). What an OpenAPI document contains, code-first vs design-first, generating docs, clients and types, and why OpenAPI specs help AI tools use your API.