Comment by boomskats
5 years ago
> doing hundreds of thousands of messages per day
> The postgres instance now runs on 32 cores and 128gb of memory and has scaled well.
Am I the only one?
5 years ago
> doing hundreds of thousands of messages per day
> The postgres instance now runs on 32 cores and 128gb of memory and has scaled well.
Am I the only one?
I should've clarified, the database handles more than just the "regular" pub/sub, some of the tables have over a billion rows.
Thank you. That makes a lot more sense and explains the value of the approach much better.
I assume that is their main database for everything, not just for pub/sub. One of the big benefits of doing it that way is that you have proper transaction handling across jobs and their related data.
Come on man… you can run the whole thing off if a few Gb instance. Such a huge instance should be able to do about 100k a second!
Potential and actual usage aren't related. They might be having a lot of records and read/writes but maybe the actual pub/sub isn't that intensive. They seem to be using the same DB for everything
Be careful not to confuse average load with peak instantaneous load. Bursty workloads are the bane of capacity planners everywhere.
Does postgres scale that well? I would be interested in case studies as I've not seen much achieving beyond 10k records per second.
Whose to say it can't?
Such a server is 400$/mo, a backend developer that can confidently maintain kafka in production is significantly more expensive!
I think the point of interest was 32 cores to handle what sounds like 10 messages per second at most. That's not really a ton of throughput... It's certainly a valid point that an awful lot of uses cases don't need Twitter-scale firehoses or Google-size Hadoop clusters.
Ah, the database does a lot more than just pub/sub - especially since the high traffic pub/sub goes through redis. I guess my point was that we never regretted setting up postgres as the "default job queue" and it never required much engineering work to maintain.
For an example, it handles stripe webhooks when users change their pricing tier - if you drop that message, users would be paying for something they wouldn't receive.
It said nothing about the distribution of traffic. It might well be thousands and thousands of pub sub messages at some point of the day and 0 for others.
Fwiw I don't know the shape of the data, but I feel like you could do this with Firebase for a few bucks a month...
you 100% could, and this thread feels like the twilight zone with how many people are advocating for using a rdbms for (what seems like) most peoples queuing needs.
20 replies →
But Kafka does significantly more.
And if your needs are simpler like in this case then there are dozens of smaller pub/sub/queue systems that you could compare this to.
Limit the types of server used to reduce system complexity. If you can have all your business state in the same place, ops are much easier.
Kafka does more for streaming data, but doesn't do squat for relational data. You always need a database, but you sometimes can get by without a queuing system.
Briefly what are some mandatory kafka use cases?
I would say postgres does much more. What use case can only Kafka handle?
It's that much on a popular cloud platform, you can buy this for 3-4 times that amount and use it for years.
Got a 128gb 32 core xeon workstation sitting under my desk off eBay and it was $400
1 reply →
Or rent it for a lot less at a traditional hosting company.
That's the job of a DevOps engineer not a backend developer attempted to be overworked.
It probably fits within the free tier limits of a managed pubsub service.
I imagine their scaling problem isn't messages/day, it's probably lots of concurrent, persistent connections. And I don't think a connection pooler would work with this job queue setup.
Yeah, every home IoT hub processes more messages than that with less thsn raspberri pi worth of compute
I certainly appreciate the sentiment though I'm pretty sure I don't have the same reliability and uptime guarantees on my little Rpi3/MQTT/NodeRed/SQLite/ESP8266 home system :-)
That said, it's been running for upwards of 4 years and accumulated an insane number of temperature readings inside and above heating vents (heat source is heat pump)
SELECT count() as count FROM temperatures : msg : Object { _msgid: "421b3777.908118", topic: "SELECT count() as count FROM …", payload: 23278637 }
Ok, I need therapy for my data hoarding - 23 million temp samples is not a good sign :-)
Curious as to why you aren’t tracking that with a time series database?
2 replies →
Are you implying that given the specs, hundreds of thousands of messages per day is not good enough? I think you are, or at least that is what I was thinking myself.
Only for hundreds of thousands of messages per day, that's way too big of a server. But if you look on the rest of the thread, it doesn't do only that.
Anyway, for a server that only does pub/sub with ACID guarantees, those specs are so large that there is certainly a bottleneck before they matter. So it wouldn't be strange if somebody gets one that can't even handle that, it just would mean that there is some issue somewhere we don't see.
Is your point that the server has room to grow? Or that you just “ain’t impressed by that”?
2 replies →
People are jumping on this. Question is—do the resource requirements outlined align with usage you described, or is that combined workload? By combined workload, I mean working set plus messaging. It’s not a useful exercise to criticize a service that’s multifaceted based on a single use case. Full disclosure—-not a Postgres user, nor am I invested in the tech.
It’s such a low throughput requirement I think even bitcoin could support it.
No, this is prob still spiky enough to have more than 7 transactions per second, that’s too much for Bitcoin.
To cherry pick two details of the post and insinuate something about it?
No.