backend
9 posts tagged with "backend"
Race Conditions in Node.js: They Exist and They'll Bite You
Node.js is single-threaded, but race conditions are real. Here's how they happen in async code and how to prevent them.
The N+1 Query Problem: Why Your API is Slow
The N+1 problem is the most common performance killer in backend applications. Here's how to detect and fix it across different ORMs.
Designing Idempotent APIs: Why Your Payment Endpoint Charges Twice
Your user clicked 'Pay' twice and got charged twice. Here's how to design APIs that handle retries, network failures, and duplicate requests without duplicating side effects.
The Node.js Event Loop: Beyond the Basics
Most explanations of the event loop are oversimplified. Here's what actually happens, phase by phase, and why it matters.
Database Connection Pooling: Why Your Server Crashes at 100 Concurrent Users
You're opening a new database connection for every request and wondering why your server dies under load. Here's how connection pooling works and how to configure it properly.
API Rate Limiting Done Right: Algorithms and Implementation
Rate limiting protects your API from abuse. Here's how the major algorithms work and which one to pick for your use case.
Redis Beyond Caching: Queues, Pub/Sub, and Rate Limiters
Redis is not just a cache. I've used it as a message queue, a rate limiter, a leaderboard engine, and a real-time event bus. Here's how, and when to stop.
Graceful Shutdown in Node.js: Stop Killing Your Users' Requests
Your Node.js server gets SIGTERM, immediately dies, and 47 users get 502 errors. Here's how to shut down properly in production.
Error Handling Patterns in Node.js: Stop Swallowing Errors
Empty catch blocks, generic error messages, and silent failures. Here are the patterns I use to handle errors properly in production Node.js applications.