lol a FOR UPDATE SKIP LOCKED post hits the HN homepage every few months it feels like
Using PostgreSQL as a Dead Letter Queue for Event-Driven Systems
21–30 of 82 posts
Re: Using PostgreSQL as a Dead Letter Queue for Event-Driven Systems
#22Earlier quoted context omitted.
Not necessarily. If you can't deliver the message somewhere you don't ACK it, and the sender can choose what to do (retry, backoff, etc.) Sure, it's unavailability of course, but it's not data loss.
If you are reading from Kafka (for example) and you can't do anything with a message (broken json as an example) and you can't put it into a DLQ - you have not other option but to skip it or stop on it, no?
Re: Using PostgreSQL as a Dead Letter Queue for Event-Driven Systems
#23Re: Using PostgreSQL as a Dead Letter Queue for Event-Driven Systems
#24Re: Using PostgreSQL as a Dead Letter Queue for Event-Driven Systems
#25> FOR UPDATE SKIP LOCKED Learned something new today. I knew what FOR UPDATE did, but somehow I've never RTFM'd hard enough to know about the SKIP LOCKED directive. Thats pretty cool.
Re: Using PostgreSQL as a Dead Letter Queue for Event-Driven Systems
#26> FOR UPDATE SKIP LOCKED Learned something new today. I knew what FOR UPDATE did, but somehow I've never RTFM'd hard enough to know about the SKIP LOCKED directive. Thats pretty cool.
only learned about SKIP LOCKED because ChatGPT suggested it to solve some concurrency problem I had. Great tool to learn such things.
Re: Using PostgreSQL as a Dead Letter Queue for Event-Driven Systems
#27Postgres has a query interface, replication, backup and many other great utilities. And it’s well supported, so it will work for low-demand applications.
Regardless, you’re using the wrong data structure with the wrong performance profile, and at the margins you will spend a lot more money and time than necessary running it . And service will suffer.
Re: Using PostgreSQL as a Dead Letter Queue for Event-Driven Systems
#28Re: Using PostgreSQL as a Dead Letter Queue for Event-Driven Systems
#29Another day, another “Using PostgreSQL for…” thing it wasn’t designed for. This isn’t a good idea. What happens when the queue goes down and all messages are dead lettered? What happens when you end up with competing messages? This is not the way.
The other system you're using that isn't Postgres can also go down. Many developers overcomplicate systems. In the pursuit of 100% uptime, if you're not extremely careful, you removed more 9s with complexity than you added with redundancy. And although hyperscalers pride themselves on their uptime (Amazon even achieved three nines last year!) in reality most customers of most businesses are fine if your system is dow…
The centralization pushes make a situation where if I have a task to do that needs three tools to accomplish, and one of them goes down, they’re all down. So all I can do is go for coffee or an early lunch because I can’t sub in another task into this time slot. They’re all blocked by The System being down, instead of a system being down.
If CI is borked I can work on docs and catch up on emails. If the network is down or NAS is down and everything is on that NAS, then things are dire.
Re: Using PostgreSQL as a Dead Letter Queue for Event-Driven Systems
#30> FOR UPDATE SKIP LOCKED Learned something new today. I knew what FOR UPDATE did, but somehow I've never RTFM'd hard enough to know about the SKIP LOCKED directive. Thats pretty cool.