Blog
News, releases and articles about @imqueue. Page 1 of 10.
Message ordering in Node.js services: why “delivered” turns back into “paid”
You send an order's status changes in the right order, and the service still stores them in the wrong one. A queue delivers in order; your service doesn't handle in order, and more instances, more brokers and re-delivered messages each make it worse. We sent 1,000 status changes and measured where the order was lost: up to four in five orders ended in the wrong state. Here is why, and the two recipes that brought it to zero in every setup.
read →An HTTP gateway in front of your Node.js services: errors, deadlines, restarts
Your services talk to each other over a queue, but browsers, mobile apps and partners speak HTTP. The gateway is the one process where the two meet, and it is where a stack trace leaks, a request hangs forever, or a deploy cuts answers off mid-flight. Here is how to build one with Express and @imqueue clients that turns service errors into clean HTTP answers, never waits forever, runs as many copies as you need, and restarts without dropping a request. Every number is measured.
read →Several Node.js services in one process: a modular monolith you can take apart later
Running a system as separate services means deploying, monitoring and paying for many processes from day one, long before most of them need it. With @imqueue/rpc 3.11 you can write separate services and run them together in one process, where their calls to each other skip the queue entirely, then move any of them out later without touching the code that calls it. Here is how, what stays exactly the same, what changes, and when to split. Every number is measured.
read →Compressing messages between Node.js services: zstd for the big ones, plain JSON for the rest
Most messages between your services are a few hundred bytes. A handful are reports, exports or month-long lists that weigh megabytes, and they are the ones that fill Redis when a consumer falls behind. @imqueue can compress just those with zstd. Here is what it saves, what it costs, where the size threshold belongs, and the rollout order that matters: a consumer that can't read zstd drops those messages for good. Every number is measured.
read →Deadlines for queued calls: stop doing work for callers who already gave up
When a service behind a queue goes down, its callers time out, but their calls don't disappear. They wait in the queue, and when the service comes back it works through every one of them. We took a billing service down for 20 seconds: the customers whose checkout said “payment failed” were all charged anyway, and every retried order was charged twice. Here is why that happens, the twenty lines that stop it, and what a queue does instead of a circuit breaker. Every number is measured.
read →