logoalt Hacker News

dfajgljsldkjagyesterday at 6:12 PM2 repliesview on HN

I have fixed many broken systems that used redis for small tasks. It is much better to put the jobs in the database we already have. This makes the code easier to manage and we have fewer things to worry about. I hope more teams start doing this to save time.


Replies

BowBunyesterday at 6:14 PM

Traditional DBs are a poor fit for high-throughput job systems in my experience. The transactions alone around fetching/updating jobs is non-trivial and can dwarf regular data activity in your system. Especially for monoliths which Python and Ruby apps by and large still are.

Personally I've migrated 3 apps _from_ DB-backed job queues _to_ Redis/other-backed systems with great success.

show 3 replies
paweldudayesterday at 6:27 PM

In Rails at least,aside from being used for background processing, redis gives you more goodies. You can store temporary state for tasks that require coordination between multiple nodes without race conditions, cache things to take some load off your DB, etc.

Besides, DB has higher likehood of failing you if you reach certain throughputs