All Posts

A shop ledger page, 1899. Every line adds up.
Choosing Hosting for a React + Django + PostgreSQL App: A Cost and Effort Framework
Compare a VPS with Docker Compose, a PaaS and managed containers for a React, Django and PostgreSQL app using criteria beyond the monthly price.
5 min read
Automatic Rollback When a Container Deploy Fails
Tag images by commit SHA, gate each deploy on a healthcheck, remember the previous image, and use a small script that reverts automatically when the new version is unhealthy.
4 min read
Debugging 502 and 404 Errors Behind a Reverse Proxy on a VPS
A systematic way to diagnose 502 Bad Gateway and 404 errors from Nginx in front of a Docker app: listening address, ports, container names, proxy_pass and firewalls.
4 min read
Keeping Postgres Data Across Docker Deploys, with Startup Order and Domain Routing
Use named volumes so a redeploy does not wipe your database, make the app wait for Postgres with a healthcheck, route a domain through Caddy, and keep backups.
4 min read
Is Docker Compose Production-Ready? What It Lacks and How to Cover the Gaps
Docker Compose can run a small production app well, but it needs restart policies, healthchecks, log limits, backups and a clear view of its zero-downtime limits.
4 min read
Deploying Docker Compose to a VPS with GitHub Actions
Build an image in GitHub Actions, push it to a registry, then SSH into a VPS to pull and restart a Docker Compose stack, with secrets handled safely.
4 min read
Indexes vs Write Speed: Weighing the Tradeoff on Busy PostgreSQL Tables
Every index speeds reads and taxes writes. Learn how to find unused indexes, understand write amplification, and use partial indexes to keep the benefit with less cost.
4 min read
Reading EXPLAIN ANALYZE When You Are New to PostgreSQL
A beginner-friendly way to read EXPLAIN ANALYZE output: what to look at first, how to compare estimated and actual rows, and what the buffers numbers tell you.
5 min read
The Missing Index on a JOIN: The Beginner Fix for Slow PostgreSQL Queries
PostgreSQL does not index foreign key columns automatically. Learn how to spot the missing index behind a slow JOIN and add it safely with CREATE INDEX CONCURRENTLY.
4 min read
Fixing Slow Serialization of Large Nested Pydantic Responses in FastAPI
An endpoint returns quickly in the database but slowly over HTTP. Profile first, then reduce response_model overhead, validate once, trim payloads, and paginate.
5 min read
Testing Async FastAPI With SQLAlchemy and pytest
Set up pytest-asyncio, dependency overrides and per-test transaction rollback so async FastAPI and SQLAlchemy tests stay isolated and avoid event loop errors.
4 min read
When Async Is Worth It in FastAPI and When Plain def Is Fine
Choose async def or def per endpoint. Learn how FastAPI threadpools sync routes, how blocking calls freeze the event loop, and when async pays off.
5 min read
Fix Async SQLAlchemy MissingGreenlet and Lazy-Loading Errors in FastAPI
MissingGreenlet means a lazy load fired outside the async context. Fix it with eager loading, expire_on_commit=False and explicit Pydantic response models.
5 min read
Celery Scales Workers but Exhausts the Database Connection Pool
More Celery workers means more PostgreSQL connections. Do the concurrency math, set CONN_MAX_AGE sensibly, and use pgbouncer to avoid too many clients errors.
5 min read
Run Django Migrations Exactly Once in a Multi-Server Deploy
Running migrate on every server at startup causes races and half-applied deploys. Run it once in a release step and keep migrations backward compatible.
5 min read
Celery Serialization Pitfalls and How task_always_eager Hides Bugs in CI
Tests pass with eager Celery but tasks fail in production on serialization. Learn why, pass IDs instead of objects, and test closer to real behavior.
4 min read
Celery Worker Killed by the OOM Killer: Diagnose and Fix Memory-Heavy Tasks
Workers disappearing with SIGKILL usually mean memory pressure. Confirm the OOM kill, then fix it with chunking, child recycling and sensible prefetch.
4 min read
Deploying New Code While Old Celery Tasks Are Still Queued
After a deploy, queued Celery messages built for the old signature hit new code and fail. Learn how to change task arguments and names safely.
4 min read