🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
HTML MASTER CLASS /// LEARN TAGS /// BUILD STRUCTURE /// SEMANTIC WEB /// HTML MASTER CLASS /// LEARN TAGS ///

Untitled Lesson

Total XP: 0|💻 backend XP: 0

Skill Matrix

UNLOCK NODES BY LEARNING NEW TAGS.

Select an unlocked node to view details root

Pascual Vila

Pascual Vila

Frontend Instructor // Code Syllabus

Common Pitfalls & Errors

The Error //

Implementing a health check that unconditionally returns 200 OK regardless of actual application state

// Wrong: no actual signal app.get("/health", (req, res) => res.sendStatus(200)); // Correct: verifies what actually matters app.get("/health/ready", async (req, res) => { res.sendStatus(await db.ping() ? 200 : 503); });

The Solution //

This provides zero real signal to the orchestrator or load balancer — an instance that has completely lost its database connection still reports itself as perfectly healthy, so traffic keeps being routed to (or the instance is never restarted despite) a genuinely broken service. A meaningful health check must actually verify the critical dependencies it relies on.

The Error //

Querying a dependency inside a health check with no timeout of its own

// Wrong: no bound on how long this can hang await db.query("SELECT 1"); // Correct: strict, short timeout independent of the check await db.query("SELECT 1", { timeout: 2000 });

The Solution //

If the dependency being checked (like a database) is slow rather than fully down, an unbounded check can hang the health endpoint itself indefinitely — turning the health check into an additional point of failure, and potentially causing the orchestrator's own probe to time out in a way that behaves unpredictably.

Continue Learning