Backend

Backend

19 posts in this category

BOT
MSG
FREE
Telegram Bot
alert • monitor • notify
BackendDevOpsNestJS

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.

11 min read18/06/2026
LOST
DIRTY
PHTM
Isolation Level
rc • rr • for update
BackendMySQLDatabase

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.

12 min read18/06/2026
DTO
DB
Validate in Code
dto • service • not db
BackendDatabase

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.

10 min read18/06/2026
TX1
LOCK
TX2
Deadlock
innodb • log • rollback
BackendMySQLDatabase

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.

12 min read18/06/2026
1
+N
SQL
SLOW
N+1 Query
orm • join • batch
BackendDatabase

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.

11 min read18/06/2026
12s
200ms
MySQL Query
explain • scan • optimize
BackendMySQLDatabase

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.

12 min read18/06/2026
N7
N8
N9
N11
NestJS Upgrade
ai • diff • test
BackendNestJSAI

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.

13 min read18/06/2026
DTO
MOD
ENT
Backend Layers
controller • service • db
BackendArchitecture

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.

12 min read18/06/2026
BE
FE
QA
Role Boundaries
api • dto • test logic
BackendArchitecture

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.

11 min read17/06/2026
HIT
TTL
DB
Cache Strategy
aside • write-through • ttl
BackendRedisDatabase

Caching strategies to reduce database load

Practical caching strategies for reducing database and API load: cache-aside, write-through, write-behind, TTLs, and invalidation.

13 min read16/06/2026
SSH
FMT
VSCode Ext
ssh • docker • prettier • lint
BackendVSCode

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.

10 min read16/06/2026
SRP
DIP
OCP
SOLID in Practice
clean • test • scale
BackendArchitecture

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.

10 min read16/06/2026
API
RAM
N+1
State and Scale
cron • file • memory
BackendArchitecture

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.

10 min read16/06/2026
1|500
EX
Logical Exception
nestjs • code • status
BackendNestJS

NestJS LogicalException and internal error codes

Standardize NestJS logic errors with message codes, LogicalException, HttpException, and internal error codes for faster debugging.

9 min read16/06/2026
FK
DB Consistency
schema • key • rule
DatabaseSQLBackend

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.

10 min read16/06/2026
PM2
LOG
UP
NestJS + PM2
restart • logs • reboot
BackendNestJSDevOpsPM2

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.

9 min read16/06/2026
JOB
30s
BullMQ Timeout
stalled • attempt • worker
BackendNestJSRedis

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.

7 min read15/06/2026
API
JOB
WORKER
BullMQ Queue
retry • delay • async
BackendNestJSRedis

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.

10 min read15/06/2026
RDS
TCP
RE
Redis Reconnect
failover • readonly • retry
BackendNestJSRedis

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.

6 min read08/06/2026