Infrastructure
What sits under an app: servers, containers, storage, backups, and the plumbing that decides whether it stays up.
45 posts · page 1 of 2
Zero-Downtime Deploys for a Small App
You don't need Kubernetes to deploy without dropping requests. What actually causes downtime during a deploy — stopping before starting, no health checks, killed requests, and database changes the old code can't handle — and the four practices that fix each one.
Why Is My Website Slow? A Beginner's Guide to Finding Out
Slow sites lose visitors. How to measure speed properly, what Core Web Vitals mean, and the usual culprits in AI-built apps — huge images, too much JavaScript, slow database queries, waterfalls of API calls, and a server far from your users — with a fix for each.
Where Should User Uploads Go? Object Storage Explained
Profile photos that vanish after a deploy, a database bloated with images, a public bucket full of private documents. Where uploaded files should live, how object storage works, and the three decisions — public or private, who uploads, and how files are served — that keep uploads fast and safe.
What Is "the Cloud"? Cloud Computing for Beginners
The cloud is other people's computers, rented by the minute. What cloud computing actually is, the difference between IaaS, PaaS, and SaaS, what AWS, Google Cloud, and Azure sell, how cloud billing works, and how much of it a first app really needs.
What Is Serverless? (There Are Still Servers)
Serverless means you write functions and the platform runs them on demand — no servers to manage, pay per use. What serverless really is, how it differs from an always-on server, cold starts, timeouts, and the database connection problem, and when it's the wrong fit.
What Is Docker? A Beginner's Explanation
Docker packages an app with everything it needs to run, so it works the same on any computer. What containers and images are, how they differ from virtual machines, why hosts and AI tools use them everywhere, and whether you need to learn Docker at all.
What Is a Server? A Plain-English Explanation
'Server' can mean a computer, a program, or a rented slice of a data centre. What a server actually is, what it does when someone visits your app, the difference between physical, virtual, and serverless, and why your laptop isn't a good one.
What Is a CDN? Why Your Site Loads Fast (or Doesn't) Far From Home
A CDN keeps copies of your site's files on servers around the world, so a visitor in Sydney doesn't wait for a server in Virginia. What a CDN does, what it can and can't speed up, how caching fits in, and the stale-content surprise that confuses beginners.
What Are WebSockets? Real-Time Features Explained
Chat, live notifications, multiplayer cursors, and dashboards that update themselves all need the server to push data to the browser. How WebSockets work, the simpler alternatives (polling and server-sent events), hosted real-time services, and what real-time needs from your hosting.
VPS vs PaaS: Where Should a Small App Live?
A VPS is cheap and does whatever you tell it — including nothing when it breaks. A PaaS runs your app for you and bills you for the privilege, often by usage. What each one actually includes, what it quietly leaves to you, and how to decide for a side project, an AI-built app, or a small business.
The Transactional Outbox Pattern: Reliable Events Without Dual Writes
Writing to your database and publishing an event can't be made atomic, so one eventually happens without the other. How the transactional outbox fixes it: polling relays vs CDC, ordering, at-least-once delivery, idempotent consumers with an inbox, cleanup, and monitoring.
Structured Logging: Logs You Can Actually Search
console.log('user saved') is useless at 3am when you need every request user 4812 made in the last hour. How structured logs work, what fields to include, request IDs that tie a request together, log levels that mean something, what never to log, and how logs make AI agents better debuggers.
Self-Hosting Next.js Without Vercel: What Works, What Breaks, What to Configure
Next.js runs anywhere Node.js does, and on a single server almost everything just works. The surprises: build-time environment variables, caching across instances, streaming behind a proxy, and a few Vercel-only conveniences. A practical guide to running Next.js on your own infrastructure.
Secrets Management Beyond .env Files
.env files are fine on a laptop and fragile everywhere else. Where secrets should live in production and CI, secret managers vs platform env vars, OIDC to remove long-lived CI credentials, rotation, least privilege, keeping secrets out of logs and AI agent context, and a practical maturity path.
How to Run AI-Generated Code Safely
AI-generated code is usually well-intentioned and occasionally destructive, and the packages it installs are a supply-chain risk of their own. A practical, layered approach — what the code can see, reach, consume, and outlive — with a hardened Docker command you can use today.
How to Run Claude Code on a Remote Server (and Keep It Running)
Running Claude Code on a server instead of your laptop means sessions survive a closed lid, a dropped connection, and a flat battery. A practical setup guide — the server, the session, the security — and what you take on by doing it yourself.
Reverse Proxies Explained: Nginx, Caddy, and Traefik in Front of Your App
A reverse proxy sits between the internet and your app, handling TLS, routing, compression, and more. What reverse proxies do, how Nginx, Caddy, and Traefik differ, forwarded headers and trusting the real client IP, WebSockets and streaming, timeouts and body limits, and common 502/504 causes.
Redis: When a Small App Actually Needs It (and When Postgres Is Enough)
Redis shows up in every architecture diagram, and AI tools add it by reflex. It's excellent at a few specific jobs — caching, rate limiting, ephemeral state, pub/sub — and unnecessary for many small apps. What it's for, what it isn't, and how to use it without losing data you cared about.
Writing a Production Dockerfile for a Node.js App
The Dockerfile an AI tool writes usually works — and ships a 1.5 GB image running as root that ignores shutdown signals and leaks build secrets into its layers. A line-by-line production Dockerfile: multi-stage builds, layer caching, non-root users, signal handling, secrets, and health checks.
Preview Environments for Every Branch: How They Work and What They Cost
A preview environment gives every branch or pull request its own live URL, so changes are reviewed running rather than read as diffs. How they work, the hard part (databases), the ways to get one, and why they matter more when an AI agent is writing the code.
Direct-to-Storage Uploads With Presigned URLs
Proxying uploads through your server wastes memory, bandwidth, and request time. How presigned URLs let browsers upload straight to S3, R2, or GCS: PUT vs POST policies, enforcing size and type, bucket CORS, confirming uploads, multipart, and serving private files.
Postgres as a Job Queue: FOR UPDATE SKIP LOCKED Done Properly
You may not need Redis or a broker for background jobs. How SKIP LOCKED makes Postgres a safe concurrent queue: claim/lease/ack, visibility timeouts and crash recovery, retries with backoff, LISTEN/NOTIFY, transactional enqueue, indexing, bloat, and its limits.
Postgres Point-in-Time Recovery: WAL Archiving, Base Backups, and Restore Drills
A nightly dump can lose a day of data. Point-in-time recovery restores to the second before the bad migration. How WAL archiving and base backups combine, the settings that matter, recovery targets and timelines, pgBackRest and WAL-G, and restore drills.
Postgres Major Version Upgrades: pg_upgrade, Logical Replication, and Minimal Downtime
Major versions change the on-disk format, so upgrading PostgreSQL isn't a package update. Dump/restore vs pg_upgrade (copy, link, clone) vs logical replication cutover; extension and collation pitfalls; sequences and DDL gaps in logical replication; statistics after upgrade; and a rehearsed runbook.