Re:Devious SQL: Message Queuing Using Native PostgreSQL
by bfelbo on Saturday January 29, 2022 @04:21PM
(#30130608)
We’ve implemented two types of queues using Postgres tables in production and it’s been working nicely. Happy to answer questions about our usage if it’s useful :)
Re:Devious SQL: Message Queuing Using Native PostgreSQL
by kumarvvr on Saturday January 29, 2022 @08:59PM
(#30133040)
How scalable do you think your system is? Can it handle 10k req/sec?
My usage is much lower than that but I want to target that number.
Re:Devious SQL: Message Queuing Using Native PostgreSQL
by bfelbo on Sunday January 30, 2022 @04:25PM
(#30141279)
We're currently keeping it as simple as possible. We just use a table and this query that runs every second:
"DELETE FROM job_queue RETURNING type, info;"
Works great and reliably so far. I think our current volume is on the order of 100-1000 req/sec. We'll likely switch to graphile-worker when we need more performance, but we're all about avoiding premature optimization. That library has been benchmarked to handle 10k req/sec: https://github.com/graphile/worker#performance
Re:Devious SQL: Message Queuing Using Native PostgreSQL
by pritambarhate on Monday January 31, 2022 @07:55AM
(#30147387)
PgSQL table based job queues should be able to handle that kind of load, but to support it you will need very high IOPS based disk. If you have NVME SSD paired with decent CPU, it should be able to manage this.
This is mainly because PgSQL based queue is durable by default and based on how you implement your inserts, every new message will need a disk based commit.
Re:Devious SQL: Message Queuing Using Native PostgreSQL
by kumarvvr on Saturday January 29, 2022 @09:48PM
(#30133373)
Would also love to hear or read about your implementation, the general architecture and failsafe constructs. Thank you.
Re:Devious SQL: Message Queuing Using Native PostgreSQL
by onlywicked on Saturday January 29, 2022 @03:49AM
(#30124858)
I don't myself but DigitalOcean had there queue system to create VMs built over MySQL.
I couldn't find the original video describing their architecture. (It's private now, I guess).
Re:Devious SQL: Message Queuing Using Native PostgreSQL
by 00000000005 on Friday January 28, 2022 @10:44PM
(#30123576)
There’s people who think using a database as a queue is bad, but if you keep pressing then for tangible reasons, it usually turns out to be emotional …… they just don’t like the idea.
Next time someone says it’s a bad idea, keep pressing for real answers, not emotion.
Re:Devious SQL: Message Queuing Using Native PostgreSQL
by bokohut on Monday January 31, 2022 @09:15PM
(#30157797)
There is a lot of ignorance around all topics but in technology it seems to be more pronounced if only because I have personal and professional interest. I felt inclined to support 10x0five in his statement as my own experiences are identical as it relates to storing files in a database. There were, and likely still are, those that proclaim over and over to never store serially linked chunked data in a database, aka files, yet after building and proving a model in production long before today's tech that stance has seemed to change. The benefits far outweigh the costs when having everything in a database which is comparable in today's uptake of putting everything under version control. Fear not what others judge about your ideas as this should just be more motivation to "press for real answers" proving yourself correct.
So, for small (but critical nonetheless) use cases, do any of you use your own custom built queues on top of a database?