All posts
56 posts about Backend, Cloud, DevOps and Homelab
NestJS Telegram Alerts: Exception Filter, Jobs, and Deploy
Telegram Bot API in NestJS: TelegramModule, exception filter for 5xx alerts, BullMQ job failures, and deploy hooks — no external libraries needed.
MySQL Isolation Levels: Common Race Conditions and How to Fix Them
MySQL's default REPEATABLE READ doesn't prevent every race condition. Dirty reads, lost updates, phantom reads, write skew — which isolation level prevents which, when SELECT FOR UPDATE is the real fix, and when optimistic locking is better.
Stop Using Database Constraints as Input Validation: Use DTOs Instead
Many backends rely on NOT NULL, VARCHAR(n), and UNIQUE constraints to catch bad input. This is the wrong layer for validation — databases aren't built for it. Where validation actually belongs: the DTO layer and service layer, before data ever reaches the DB.
MySQL Deadlock: How to Read InnoDB Logs and Reduce Occurrence
MySQL auto-resolves deadlocks but randomly rolls back a transaction, causing errors at the app layer. How to read SHOW ENGINE INNODB STATUS to find exactly which row was locked, common causes, and 5 ways to reduce deadlock probability.
N+1 Query in Prisma, TypeORM, and Sequelize: How to Detect and Fix It
N+1 query causes no errors but makes APIs slow as data grows — ORM fetches a list with 1 query then fires N more for each item. How to catch it with SQL logging, count queries per request, and fix with eager loading, batching, or DataLoader.
Can SQL handle large datasets? Indexes and query design in MySQL
Why SQL still works well at scale when schema, indexes, and query design are correct, from filtering before joins to MySQL patterns for millions of customers.
MySQL ORDER BY + LIMIT Slow Despite Index: Filesort, Composite Index, and Cursor Pagination
ORDER BY combined with LIMIT can trigger a filesort over millions of rows even with indexes in place. How MySQL picks its execution plan, how to read EXPLAIN, and 4 practical optimization patterns.
How to upgrade NestJS 7 to 11 with AI and fewer mistakes
A practical way to upgrade an old NestJS service with AI: move one major version at a time, isolate breaking changes, review git diffs, and avoid changing business logic.
How to separate DTO, Model, and Entity in backend code
How to separate DTO, Model, and Entity in backend code so controller, service, and database layers do not get mixed together, especially with TypeORM.
How to separate backend, frontend, and QA responsibilities in a team
How to separate backend, frontend, and QA responsibilities to avoid blame, broken API contracts, unclear validation, and test cases drifting from the real system logic.
Cloudflare Workers vs Pages: when to use each
Compare Workers and Pages: serverless functions, static hosting, Pages Functions, use cases, and how to choose for each project.
Use Cloudflare Queues and KV for side projects
Use Cloudflare Queues for async jobs and Workers KV for cache or config in personal projects running on Workers or Pages.
4 Cloudflare features worth enabling: DNS, CDN, SSL, DDoS
Four core Cloudflare features worth using for a website: faster DNS, free CDN, automatic SSL, and DDoS protection.
Cloudflare D1 Database: when should you use it?
Cloudflare D1 is serverless managed SQLite for Workers and Pages, useful for small side projects but limited if you later need MySQL/PostgreSQL.
Cloudflare R2 vs AWS S3: Cost, Egress Fees and Free Tier Compared
Compare Cloudflare R2 and AWS S3 on pricing, egress fees, free tiers, when R2 is cheaper, and how to migrate with an endpoint change.
Synology on Proxmox: pros, cons, SHR, and RAID
Pros and cons of running Synology DSM on Proxmox through Xpenology, plus RAID 0/1/5/6, SHR, and SHR-2 comparison.
How to Use Proxmox to Create Isolated VMs for Each Project
Install Proxmox VE, create VMs, clone from templates, and manage storage for homelab projects that need isolated environments.
Caching strategies to reduce database load
Practical caching strategies for reducing database and API load: cache-aside, write-through, write-behind, TTLs, and invalidation.
5 VS Code extensions backend developers should install
Remote SSH, Docker, Prettier, ESLint, and Code Spell Check: five VS Code extensions for everyday backend development.
How to Load Balance with HAProxy on Docker Compose
Deploy HAProxy as a Docker Compose load balancer with round-robin routing, health checks, and the Stats UI for monitoring backends.
Apply SOLID to reduce coupling in large projects
A practical guide to applying SOLID in real projects to reduce coupling, avoid messy code, improve testability, and make large systems easier to extend.
Stateless vs stateful code when scaling instances
Understand stateless and stateful backend code, plus common scaling bugs like duplicate schedulers, local files, and memory state.
Manage EC2 production: Docker logs, CPU, and RAM
A practical EC2 production checklist: limit Docker logs, avoid full disks, and monitor CPU, RAM, disk, network, and status checks.
Move nameservers to Cloudflare and point DNS records
Move a domain to Cloudflare nameservers, point A or CNAME records to a VPS, and choose between DNS only and Proxied mode.
Install Linux Mint and set it up for daily use
Install Linux Mint from a bootable USB, choose the right edition, configure basic settings, and start using it day to day.
What can an old PC do? Linux, homelab, NAS, apps
Why an old PC may feel slow on Windows but become valuable again for Linux users, homelab setups, mini servers, NAS use, and hosting personal web apps.
Use Tailscale Funnel to expose a machine online
Use Tailscale for remote access and Tailscale Funnel to expose a web service, with Serve vs Funnel differences and tradeoffs.
Turn an old PC into a NAS with Ubuntu and Samba
A practical guide to turning an old PC into a storage NAS with Ubuntu, using Samba for LAN file sharing and WebDAV over HTTPS for remote or internet access.
Expose an app with AWS EC2 and Elastic IP
A practical guide to launching an AWS EC2 instance, understanding Security Groups, attaching an Elastic IP, and exposing an app to the internet more safely.
Use EC2 t3.micro, Headscale, and Tailscale for homelab
Use EC2 t3.micro to host Headscale, connect PCs with Tailscale, and add Nginx for reverse proxy or public app access.
Build a free static blog with Cloudflare Pages
Use Cloudflare Pages to host a static blog for free, understand what static sites are, why they scale, and which limits still matter.
The role of indexes and the query patterns that make MySQL slow
Why indexes matter in MySQL, and common slow-query patterns such as missing indexes, selecting too much data, or filtering in application code.
NestJS LogicalException and internal error codes
Standardize NestJS logic errors with message codes, LogicalException, HttpException, and internal error codes for faster debugging.
Design a consistent database with fewer data bugs
Practical database design rules for consistent data: naming, primary keys, foreign keys, unique constraints, not null, and enough normalization.
Install Docker on Ubuntu with docker.io
Install Docker quickly on Ubuntu with apt, add your user to the docker group, and verify the setup with hello-world.
Codex vs Claude Code vs Cursor vs GitHub Copilot
Compare Codex, Claude Code, Cursor, and GitHub Copilot on pricing, VS Code support, autocomplete, agent coding, and use cases.
Run NestJS in production with PM2 restart and logs
Use PM2 to run NestJS on a Linux server, build the app, start it with an ecosystem file, inspect logs, restart on crashes, and restore after reboot.
Run Ollama locally with Docker Compose and Open WebUI
Install Ollama locally with Docker Compose, use Open WebUI for chat, call the local API, and choose a model for your machine.
What is GPT-5.5 and is it in ChatGPT and API?
A quick update on OpenAI GPT-5.5: release date, strengths in coding and agentic work, and availability in ChatGPT and the API as of June 16, 2026.
What is Claude Fable 5 and why was access suspended?
Claude Fable 5 was announced by Anthropic on June 9, 2026, but access to Fable 5 and Mythos 5 was suspended on June 12, 2026.
BullMQ Job stalled with ElastiCache while Redis is healthy
Why BullMQ timeout and Job stalled errors happen with AWS ElastiCache Redis, and how to fix worker and connection settings.
Install Ubuntu 24.04 LTS for Vietnamese users
Step-by-step Ubuntu 24.04 LTS installation for a dev machine or personal desktop, with notes for stable Vietnamese typing.
Use Synology NAS with SMB, Drive, and Photos
Use Synology NAS for SMB/Samba, Synology Drive, Photos, mobile apps, and controlled file sharing on LAN or over the Internet.
Use Cloudflare Tunnel when router ports are blocked
How to use Cloudflare Tunnel to expose an old PC or mini server when you cannot open router ports, are behind CGNAT, or are on a shared apartment network.
Docker Compose for multi-project local dev
Use Docker Compose to run multiple projects side by side, avoid port conflicts, isolate MySQL and Redis, and keep local dev easy to reset.
Redis queue in NestJS with BullMQ: how to implement it
Use Redis as a queue in NestJS with BullMQ, including producer-consumer flow, retries, delayed jobs, and production notes.
Nginx Proxy Manager with Docker Compose and SSL
Run Nginx Proxy Manager with Docker Compose, point multiple domains to one server, reverse proxy internal apps, and request SSL certificates.
Ubuntu Vietnamese input: ibus-bamboo or fcitx5-unikey?
Compare ibus-bamboo and fcitx5-unikey on Ubuntu, including GNOME, Electron apps, predict bar issues, and stable typing choices.
Xpenology on Proxmox VE 8.2.4 with HDD passthrough
How to install Xpenology DSM 7.2.1 on Proxmox VE 8.2.4 and configure HDD passthrough so DSM can read SMART data natively.
Resize an EC2 EBS volume and extend XFS without data loss
Step-by-step guide to expanding an EBS volume and growing an XFS filesystem on EC2 Ubuntu — online and without downtime.
NestJS Redis disconnects: configure ioredis reconnect
How to configure ioredis in NestJS to reconnect safely when Redis disconnects, TCP idle timeouts happen, or ElastiCache failover returns READONLY.
Optimizing a MySQL query on 300k+ records
Case study: bringing a MySQL query from 12 seconds down to 200ms using EXPLAIN, composite indexes, and a query rewrite.
Container exit 137: debug OOMKilled and memory limits
Debug Docker or Kubernetes containers restarting with exit code 137, tune Node.js memory limits, and inspect possible memory leaks.
Proxmox cluster loses quorum and how to recover
pvecm status reports 'not in quorum', VMs freeze — how to use pvecm expected, pvecm delnode, and set up QDevice to prevent it next time.
Add drives to Synology SHR without data loss
How to add a drive to an SHR storage pool on DSM, track reshape progress via /proc/mdstat, and what to watch out for to keep your data safe.
Nginx 413 after client_max_body_size: how to fix it
Why Nginx still returns 413 even after setting client_max_body_size, and how to fix it when you have multiple proxy or reverse proxy layers.