zlacker

[return to "Postgres is a great pub/sub and job server (2019)"]
1. fouadf+tx[view] [source] 2021-12-18 03:08:22
>>anonu+(OP)
A single core small Redis server can do wonders.

For fire and forget type jobs you can use lists instead of pub/sub: save a job to a list by a producer, pop it on the other end by a consumer and execute it. It's also very easy to scale, just start more producers and consumers.

We're currently using this technique, to process ~2M jobs per day, and we're just getting started. Redis needs very little memory for this, just a few mb.

Redis also supports acid style transactions.

◧◩
2. joshle+2Z1[view] [source] 2021-12-18 18:02:53
>>fouadf+tx
The problem is that you can't atomically write to your other database and also put a message on a redis queue. So you'll either end up with db changes not conveyed to redis, or you'll have messages on redis not reflected by changes to the db.
[go to top]