Re:Do you really need Redis? How to get away with just Postg...
by politician on Saturday June 12, 2021 @01:20PM
(#27485922)
Not sure why you were downvoted, but perhaps they were thinking about Redis transactions (lua scripts that can do multiple operations at once). If Redis is your datastore (groan), then you can transactionally enqueue tasks with your unit of work.
Re:Do you really need Redis? How to get away with just Postg...
by stickfigure on Sunday June 13, 2021 @12:20AM
(#27489722)
If Redis is your primary datastore then sure. But the problem domain for which "Redis is your primary datastore" is appropriate is relatively narrow.
Re:Do you really need Redis? How to get away with just Postg...
by arthurcolle on Saturday June 12, 2021 @03:31PM
(#27486890)
Real time trading systems can totally get away with only using Redis, outside of historical data (which obviously you'd stick into Postgres or your favorite flavor of DB)
Re:Do you really need Redis? How to get away with just Postg...
by GordonS on Saturday June 12, 2021 @01:42PM
(#27486100)
You can actually do this with RabbitMQ - it has a feature called "Publisher Confirmations", where you send a message, and then wait for an "ack" in return.
Re:Do you really need Redis? How to get away with just Postg...
by blowski on Saturday June 12, 2021 @02:08PM
(#27486320)
If you’re using the same database for your queue as your business entities, then you can wrap both in the same transaction - I think that’s what the parent post is getting at. For example, save a customer entity and add a job to send them a confirmation email. As far as I know, that’s something you can’t do natively if you’re using RabbitMQ and PostgreSQL. Of course you can work around it, but when your workloads are low you don’t need to, which is great for early stage products.
Re:Do you really need Redis? How to get away with just Postg...
by spullara on Saturday June 12, 2021 @02:45PM
(#27486592)
In that case it doesn't help you that much since you can't transactionally send an email but you would get at least one attempt.
If your load requirements fit using your database as a queue, it can radically simplify your system.
I've personally done a fair bit of migration from formal queue systems into an RDBMS. You simply get a lot more control and visibility that way. But I use task queues heavily too. It's all very application-specific and I don't think you can generalize.