It is 2 AM. Your on-call alert triggers because your backend service is failing health checks and returning 504 Gateway Timeouts.
You dig through the logs expecting a database deadlock or a memory leak. Instead, you find the root cause: a third-party email provider slowed down, causing your HTTP request handlers to stack up, exhaust the connection pool, and bring down the entire checkout flow.
Your core application logic did not fail. Your API crashed because a non-critical downstream dependency took the main process down with it.
This failure mode happens when systems rely on synchronous processing for operations that do not need to happen in real time. Introducing a message queue eliminates this tight coupling.
The Problem: Tight Synchronous Coupling
Consider a standard e-commerce checkout route written synchronously.
// Tightly coupled checkout handler app . post ( '/api/checkout' , async ( req , res ) => { try { const order = await db . createOrder ( req . body ) ; await paymentGateway .…