Skip to content

Writing on backend, performance & AI

Write-ups from production: what broke, what I measured, and what I'd do again.

All posts

Laravel or NestJS for a new backend

PHP or Node for a greenfield service: what each ecosystem gives you for free, where hosting and hiring differ, and the conditions that actually decide it.

5 min read#php#laravel#nestjs

Eloquent N+1 queries: find them, then fix them

The slowest Laravel pages are usually one loop issuing a query per row. How to make N+1 visible, fix it with eager loading, and stop it coming back.

4 min read#php#laravel#performance

Laravel caching with Redis, past the basics

Cache::remember is the easy part. Stampedes, tags, TTL jitter, locks and what actually belongs in the cache on a busy Laravel application.

4 min read#php#laravel#redis

Laravel queues: retries, failures and what to watch

A queued job will run twice and fail at the worst time. Configuring tries and backoff, making jobs safe to retry, and reading the failed_jobs table before users do.

4 min read#php#laravel#reliability

Moving a blog from a CMS to Markdown files

Dropping a hosted CMS for files in the repo: exporting the content, converting rich text, keeping every URL alive, and verifying nothing was lost.

4 min read#nextjs#seo#architecture

Node.js vulnerabilities in 2026: Node2Shell and the registry

October's Brotli out-of-bounds write gives remote code execution through fetch() and body parsing. Plus the TLS fixes shipped beside it, and why npm trusted publishing did not end supply-chain worms.

7 min read#nodejs#security#npm

NestJS or Express for a new Node API

Two defensible choices with different bills. What each costs on day one and in month twelve, and the few conditions that genuinely decide it.

5 min read#nodejs#nestjs#express

NestJS modules and DI without the ceremony

NestJS asks for decorators and modules before it gives anything back. What each piece is actually for, and how to use the container without over-engineering.

5 min read#nodejs#nestjs#architecture

Express middleware order and error handling

Middleware runs in the order you register it, and most Express bugs are that sentence ignored. Correct ordering, async errors, and one handler that owns responses.

5 min read#nodejs#express#reliability

Structuring an Express API that outlives sprint one

Express gives you a router and no opinions. The folder layout, boundaries and conventions that keep a Node API readable once it is twenty routes and three developers.

4 min read#nodejs#express#architecture

How to read a slow MySQL query plan

EXPLAIN tells you what MySQL decided to do. How to read the rows, type and key columns, spot the three patterns that cause most slow queries, and fix them.

4 min read#mysql#performance#architecture

Multi-tenant data isolation without the leak

One tenant seeing another's records is the bug you cannot apologise your way out of. Shared tables, schemas or databases — and how to make the choice enforceable.

5 min read#architecture#saas#postgres

Drizzle or raw SQL: picking a data layer

Query builders promise type safety, raw SQL promises control. What each actually costs in a TypeScript service, and the hybrid most teams end up with.

4 min read#nodejs#typescript#postgres

What a RAG answer actually costs per question

RAG pricing is not the model price. Embeddings, retrieved context, system prompt and retries all bill per answer — how to work out the number before you ship.

5 min read#ai#rag#architecture

How to find a Node.js memory leak in production

Memory that climbs until the process restarts. How to tell a leak from a cache, take heap snapshots safely, and read the comparison that names the culprit.

5 min read#nodejs#performance#reliability

Catch Core Web Vitals regressions in CI

A Lighthouse run in CI turns performance into a test. How to set budgets that fail a pull request without failing on noise, and what to gate versus warn on.

4 min read#performance#devops#nextjs

What is actually in your Next.js JavaScript bundle

Shipping less JavaScript starts with knowing what is in it. Reading the build output, running the analyzer, and the four imports that usually explain the size.

5 min read#nextjs#performance#react

Why your AWS bill jumped: the NAT gateway trap

A NAT gateway bills per hour and per GB, and private subnets route almost everything through it. How to spot the charge and fix it with VPC endpoints.

5 min read#aws#devops#architecture

Idempotent APIs and webhooks: making retries safe

Retries are not optional, so duplicate requests are not either. Idempotency keys, natural keys and upserts that make a replayed request cost nothing.

6 min read#architecture#php#reliability

How to fix Cumulative Layout Shift in Next.js

CLS is caused by content that arrives without reserved space: images, fonts, ads and client-only widgets. How to find each shift and reserve space for it.

5 min read#performance#nextjs#react

How to fix Largest Contentful Paint in Next.js

LCP is usually one element and one slow step. How to find both in Next.js: the image, the font, the server response, and the render path that delays them.

5 min read#performance#nextjs#react

What does a custom CRM actually cost to build?

A cost model for custom CRM development: what drives the number, where budgets overrun, and how an off-the-shelf subscription compares over three years.

5 min read#crm#architecture#saas

Sync production MySQL to your laptop, safely

Read-only users, a source-to-local DB map, structure-only tables for PII, and gzip streaming: the small Bash script I use to debug safely with real data.

3 min read#mysql#bash#devops

llms.txt and GEO: what the evidence shows

Google ignores llms.txt and ~97% of published files get zero AI crawler requests. Publish one anyway, in twenty minutes, then spend the real time on crawler access and answer-first pages.

5 min read#geo#ai-search#seo

Next.js App Router caching: the four caches explained

Caching in the App Router is opt-in since Next.js 15, which inverts most guides written for 14. The four caches, what makes a route dynamic, and Cache Components in 16.

4 min read#nextjs#web-development#performance