3 ms·
A queue is a thing to be managed carefully when designing systems: - you need to ensure that your producers don't produce at a faster rate than your consumers
by mgaunard 3y ago
A queue is a thing to be managed carefully when designing systems:
- you need to ensure that your producers don't produce at a faster rate than your consumers can keep up
- if the consumer is unable to handle the request now, queueing it and handling it later is often not the right thing to do. Most likely by the time the resource is available the nature of the request will change.
TCP itself is already a queue. All these message queue systems also make the silly decision of layering their own queueing on top of TCP, leading to all sorts of problems.
Basically those things only sort of work if you have few messages and are happy with millisecond latency.
- masom 3y agoIt really depends what you design your system to handle. A sudden burst of traffic that can be spread for minutes is fine (ex: Elasticsearch indexing requests can usually be delayed through background jobs). > Basically those things only sort of work if you have few messages and are happy with millisecond latency. Not really... queues are great to defer processing or have longer running job than your HTTP and TCP timeouts will allow. Building large data export won't happen within a single HTTP request. ex: https://shopify.engineering/high-availability-background-jobs https://shopify.engineering/high-availability-background-job...