3 ms·
SQS is at least once PG can give you exactly once
by qaq 3y ago
SQS is at least once
PG can give you exactly once
- qaq 3y agoNot sure why this is making people upset.
- williamdclt 3y agoBecause it's incorrect. If you have any non-postgres side-effect, you can't have exactly-once (unless you do 2PC or something like that). There isn't any technology that gives you "exactly once" in the general case.
- qaq 3y agoThat's not how exactly once is defined for queue. We are talking about semantics of what queue systems is providing.
- silon42 3y agoNobody will understand it like that.
- qaq 3y agoAnyone who has ever selected queue service/product will understand it like that. Because thats one of the most prominent features that gets highlighted by those products: SQS Standard queues support at-least-once message delivery. NATS offers "at-most-once" delivery etc.
- rcaught 3y agoSQS FIFO has exactly-once processing
- qaq 3y agowell that's a stretch it has "5 minute window" You can hold a lock on a row in PG queue for as long as you need
- chuckhend 3y agopgmq (which is linked on this gist) provides an api to this functionality. It can be 0 seconds, or 10 years if you want. It's not a row lock in, which can be expensive. In pgmq, its build into the design of the visibility timeout. FOR UPDATE SKIP LOCKED is there to ensure that only a single consumer gets any message, and then the visibility timeout lets consumer determine how long it should continue to remain unavailable to other consumers.