zlacker

[return to "Do you really need Redis? How to get away with just PostgreSQL"]
1. pilif+p9[view] [source] 2021-06-12 08:43:02
>>hyzyla+(OP)
For pub/sub, I would recommend against using PostgreSQL if you're doing it at any kind of scale because LISTEN ties up one connection completely and Postgres connections are very expensive compared to a redis connection.
◧◩
2. gunnar+7a[view] [source] 2021-06-12 08:52:03
>>pilif+p9
The other issue with LISTEN/NOTIFY is that a client will miss any notifications sent while it is not running (e.g. due to crash, update, etc.). An alternative would be logical replication and change data capture (CDC), as provided for Postgres by Debezium for instance. That way, any consumers won't miss events during downtimes, as they'll continue to read from the replication slot from the last offset they had processed.

Disclaimer: I work on Debezium

◧◩◪
3. superm+zb[view] [source] 2021-06-12 09:10:40
>>gunnar+7a
isnt this also the case for redis pubsub?
◧◩◪◨
4. philjo+Rc[view] [source] 2021-06-12 09:26:25
>>superm+zb
I'd need to check, but I think so.

Which is probably why if you don't want loss if consumers go down a proper queue system (RabbitMQ, ActiveMQ, Amazon SQS, Kafka if you don't care about ordering between partitions) is the way I'd go.

[go to top]