Menu

Simplest Library and API Combo for Adding Rate Limiting to Node.js Queues — 3 Gates
📰

Simplest Library and API Combo for Adding Rate Limiting to Node.js Queues — 3 Gates

DEV Community: node·eliasfischer8351·17 days ago
#TT51D6U7
#devtonodejs#devto#dev#queue#provider
Reading 0:00
15s threshold

A nightly payment-provider reconciliation is a rate-limiting problem before it is a queue-library problem. For a customer-support system, the practical default is a small limiter such as Bottleneck in front of a queue consumer, with a durable queue API handling delivery, acknowledgement, retries, and dead-letter work.

The important qualification is that one limiter is not enough. Use three gates: a concurrency ceiling so workers do not overwhelm the provider, a token or reservoir limit for the provider's request budget, and an idempotent reconciliation record so an at-least-once delivery cannot post the same result twice. That arrangement keeps the latency-versus-cost decision visible instead of hiding it in a worker pool.

The input is usually less tidy than the schedule suggests.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.