zlacker

[return to "Do you really need Redis? How to get away with just PostgreSQL"]
1. nickjj+Tg[view] [source] 2021-06-12 10:13:32
>>hyzyla+(OP)
I think one of the biggest advantages of using Redis for job queing vs Postgres comes down to library support.

For example Python has Celery and Ruby has Sidekiq. As far as I know there's no libraries in either language that has something as battle hardened with comparable features for background tasks using Postgres as a backend.

There's a big difference between getting something to work in a demo (achievable by skimming PG's docs and rolling your own job queue) vs using something that has tens of thousands of hours of dev time and tons of real world usage.

I'm all for using PG for things like full text search when I can because it drastically reduces operation complexity if you can avoid needing to run Elasticsearch, but Redis on the other hand is a swiss army knife of awesome. It's often used for caching or as a session back-end so you probably have it as part of your stack already. It's also really easy to run, uses almost no resources and is in the same tier as nginx in terms of how crazy efficient it is and how reliable it is. I don't see not using Redis for a job queue as that big of a win.

◧◩
2. kortex+7U[view] [source] 2021-06-12 16:55:58
>>nickjj+Tg
Totally agree. The number of job queues which use or can use Redis as the backing store is legion. Celery, rq, arq, Golang has asynq (inspired by sidekiq iirc), and that's off the top of my head. IMHO, it's just a better interface for implementing a job queue than an RDB.

It's also probably one of the easiest services to deploy and manage; often a one-liner.

Plus like you said, swiss army knife. It has so many uses. It's inevitable my stack will include a redis at some point, and my reaction is almost always "I should have just started with redis in the first place."

Is redis prone to golden hammer syndrome? Of course. But as long as you aren't too ridiculous, I've found you can stretch it pretty far.

◧◩◪
3. advent+ev1[view] [source] 2021-06-12 22:44:01
>>kortex+7U
Redis and I have a golden hammer agreement. I keep finding new ways to use it and it just keeps working.
[go to top]