The Daily
A note a day on APIs and the realities of shipping web applications. Stuff I've actually learned across 25 years of doing the work.
Eager Loading Is Not Always the Answer in Laravel
Sometimes a 40-join Eloquent query is worse than lazy loading. Here's when I reach for chunked lazy loading instead.
The conventional wisdom in Laravel land is "always eager load your relationships." Avoid the N+1 problem. Use . Done. And most of the time, that advice is correct. But I burned a queue worker to the ground last year following it blindly, and I want to talk about what actually happened. The Setup I was building a…
Read the daily →Caddy as an nginx Drop-in on a Laravel VPS: Mostly Great, Sometimes a Fight
I swapped nginx for Caddy on a client VPS last year. Automatic HTTPS is genuinely magic. A few things will bite you if you're not ready.
I've been running nginx in front of PHP-FPM for so long that switching felt like switching hands for a handshake. But after helping a client migrate a Laravel app to a fresh Ubuntu VPS last year, I decided to give Caddy a real shot instead of reaching for my usual nginx boilerplate. The automatic HTTPS alone saved me…
Read the daily →Docker Compose Overrides Are the Env Layer You're Already Missing
Most teams fork their docker-compose.yml per environment and spend the next year keeping three files in sync. There's a better way.
Most teams I talk to have three versions of — one for dev, one for staging, one for prod — and they're all 80% identical. Someone changed the base image six months ago, updated dev and prod but forgot staging, and now staging has been silently running a different PHP version for half a year. I've seen this exact…
Read the daily →Five Observability Signals You Already Have (No Datadog Required)
You don't need a $500/month SaaS to know if your server is sick. The signals are already there in nginx, MariaDB, and systemd.
I've never had a client who wanted to pay for Datadog. I've had plenty who needed what Datadog sells. Most of the time I can give them 80% of it for free, using log data that their server is already producing and throwing away. This isn't a "Datadog is bad" post. Datadog is genuinely good. But for the kind of work I…
Read the daily →Shipping Laravel Logs to Self-Hosted Loki on the Same Box
You don't need Grafana Cloud or a separate observability server. Here's how I run Loki + Grafana on the same box as Laravel and actually sleep at night.
Loki is not Elasticsearch. That's the first thing worth understanding, because if you approach it expecting Elasticsearch's full-text indexing model, you'll either fight it or give up. Once I stopped fighting it, I got a log aggregation stack running on the same $40 VPS as a Laravel app — no Grafana Cloud account, no…
Read the daily →