zlacker

[parent] [thread] 34 comments
1. colinc+(OP)[view] [source] 2021-12-18 00:31:49
Such a server is 400$/mo, a backend developer that can confidently maintain kafka in production is significantly more expensive!
replies(6): >>macksd+n >>rockwo+B4 >>lern_t+fa >>threes+La >>remram+Rp >>pts_+AN
2. macksd+n[view] [source] 2021-12-18 00:34:27
>>colinc+(OP)
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.
replies(2): >>colinc+C >>rowanG+CW6
◧◩
3. colinc+C[view] [source] [discussion] 2021-12-18 00:36:23
>>macksd+n
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.

4. rockwo+B4[view] [source] 2021-12-18 01:09:49
>>colinc+(OP)
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...
replies(1): >>daenz+E9
◧◩
5. daenz+E9[view] [source] [discussion] 2021-12-18 01:49:36
>>rockwo+B4
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.
replies(3): >>tata71+9a >>tomc19+7p >>foepys+Mw
◧◩◪
6. tata71+9a[view] [source] [discussion] 2021-12-18 01:54:19
>>daenz+E9
Does Firebase offer self-hosting these days?

What do you say to those who don't want Google to know their usage info?

replies(1): >>pricci+6b
7. lern_t+fa[view] [source] 2021-12-18 01:54:44
>>colinc+(OP)
It probably fits within the free tier limits of a managed pubsub service.
8. threes+La[view] [source] 2021-12-18 02:00:34
>>colinc+(OP)
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.

replies(3): >>speed_+lj >>moneyw+bm >>akvadr+3K
◧◩◪◨
9. pricci+6b[view] [source] [discussion] 2021-12-18 02:04:03
>>tata71+9a
Checkout supabase.com. It is based on postgres.
◧◩
10. speed_+lj[view] [source] [discussion] 2021-12-18 03:30:17
>>threes+La
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.

◧◩
11. moneyw+bm[view] [source] [discussion] 2021-12-18 03:58:30
>>threes+La
Briefly what are some mandatory kafka use cases?
◧◩◪
12. tomc19+7p[view] [source] [discussion] 2021-12-18 04:31:45
>>daenz+E9
Dude you are seriously underestimating postgres' versatility. It does so many different things, and well!
replies(1): >>daenz+us
13. remram+Rp[view] [source] 2021-12-18 04:42:05
>>colinc+(OP)
It's that much on a popular cloud platform, you can buy this for 3-4 times that amount and use it for years.
replies(2): >>tluybe+nE >>discor+HN
◧◩◪◨
14. daenz+us[view] [source] [discussion] 2021-12-18 05:16:46
>>tomc19+7p
I'm not underestimating anything. I am advocating for the right tool for the job. I have a hard time believing, despite the skewed sample size in this thread, that most people think using postgres as a message queue for most cases makes the most sense.
replies(3): >>tomc19+4v >>qetern+Yi1 >>michae+gi2
◧◩◪◨⬒
15. tomc19+4v[view] [source] [discussion] 2021-12-18 05:46:29
>>daenz+us
What is your idea of 'most cases'?

I've personally written real-time back-of-house order-tracking with rails and postgres pubsub (no redis!), and wrote a record synchronization queuing system with a table and some clever lock semantics that has been running in production for several years now -- which marketing relies upon as it oversees 10+ figures of yearly topline revenue.

Neither of those projects were FAANG scale, but they work fine for what is needed and scale relatively cleanly with postgres itself.

Besides, in a lot of environments corporate will only approve the use of certain tools. And if you already have one approved that does the job, then why not?

replies(1): >>daenz+Hz
◧◩◪
16. foepys+Mw[view] [source] [discussion] 2021-12-18 06:09:00
>>daenz+E9
Why should I rely on yet another microservice when I have PostgreSQL right there?
replies(1): >>daenz+TA
◧◩◪◨⬒⬓
17. daenz+Hz[view] [source] [discussion] 2021-12-18 06:48:38
>>tomc19+4v
>some clever lock semantics

Most senior+ engineers that I know would hear that and recoil. Getting "clever" with concurrency handling in your home-rolled queuing system is not something that coworkers, especially more senior coworkers, will appreciate inheriting, adapting, and maintaining. Believe me.

I get that you're trying to flex some cool thing that you built, but it doesn't really have any bearing on the concept of "most cases" because it's an anecdote. Queuing systems are a thing for a reason, and in most cases, using them makes more sense than writing your own.

replies(3): >>pritam+GF >>tomc19+wG >>fanf2+ER
◧◩◪◨
18. daenz+TA[view] [source] [discussion] 2021-12-18 07:03:55
>>foepys+Mw
Everything is a nail, why should I use anything but this hammer?
replies(3): >>pritam+WF >>tluybe+xG >>Dowwie+VW
◧◩
19. tluybe+nE[view] [source] [discussion] 2021-12-18 07:46:05
>>remram+Rp
Or rent it for a lot less at a traditional hosting company.
◧◩◪◨⬒⬓⬔
20. pritam+GF[view] [source] [discussion] 2021-12-18 08:01:46
>>daenz+Hz
> Most senior+ engineers that I know would hear that and recoil. Getting "clever" with concurrency handling in your home-rolled queuing system is not something that coworkers, especially more senior coworkers, will appreciate inheriting, adapting, and maintaining. Believe me.

I am both a "senior+ engineer" that has inherited such systems and an author of such systems. I think you're overreacting.

Concurrency Control (i.e., "lock semantics") exists for a reason: correctness. Using it for its designed purpose is not horror. Yes, like any tool, you need to use it correctly. But you don't just throw away correctness because you don't want to learn how to use the right tool properly.

I have inherited poorly designed concurrency systems (in the database); yes, I recoiled in horror and did not appreciate it. So you know what I did? I fixed the design, and documented it to show others how to do it correctly.

I have also inherited OOB "Queuing Systems" that could not possibly be correct because they weren't integrated into the DB's built-in and already-used correctness system: Transactions and Concurrency Control. Those were always more horrific than poorly-implemeneted in-DB solutions. Integrating two disparate stores is always more trouble than just fixing one single source.

----

> I get that you're trying to flex some cool thing that you built, but it doesn't really have any bearing on the concept of "most cases" because it's an anecdote. Queuing systems are a thing for a reason, and in most cases, using them makes more sense than writing your own.

I get that you're trying to flex that you use turnkey Queueing Systems, but it doesn't really have any bearing on the concept of "most cases", because all you've presented are assertions without backing. Queuing systems are good, for a specific kind of job, but when you need relational logic you better use one that supports it. And despite what MongoDB and the NoSQL crowd has been screaming hoarsely for the past decade, in most cases, you have relational logic.

◧◩◪◨⬒
21. pritam+WF[view] [source] [discussion] 2021-12-18 08:05:23
>>daenz+TA
Postgres happens to be a very good hammer, thank you very much. You should try it sometime.

But seriously though, postgres's relational logic implementation makes for a very good queueing system for most cases. It's not a hack that's bolted on top. I know that's how quite a few "DBs" are designed and implemented, and maybe you've been burned by too many of them, but Postgres is solid. I've seen it inside and out.

◧◩◪◨⬒⬓⬔
22. tomc19+wG[view] [source] [discussion] 2021-12-18 08:12:37
>>daenz+Hz
Well, you'd have to see it before you judge. It's super simple, like 5 or 10 lines total. Handles 1000x+ the traffic it sees. In any case concurrency is nothing to be afraid of. Do they not teach dining philosophers any more?

My point is that postgres is a swiss army knife and you and anyone else would be remiss to not fully understand what it is capable of and what you can do with it. Entire classes of software baggage can be eliminated for "most" use cases. One could even argue that reaching for all these extra fancy specialized tools is a premature optimization. Plus, who could possibly argue against having fewer moving parts?

◧◩◪◨⬒
23. tluybe+xG[view] [source] [discussion] 2021-12-18 08:12:56
>>daenz+TA
Make every system as complex as you can with tech you are not really familiar with is a good plan for your small team? Under a 100 people, your company does not have 100 devops etc to make sure all these 'best of breed' tools actually managed properly in production. If a service on top of postgres dies, I will find out why very quickly; on Kafka, even though I have used it a bunch of times, I usually have no clue; just restart and pray. Why would I force myself to use another tool when postgres actually works well enough? Resume driven?

Sometimes I agree with best tool for the job; if the constraints make something a very clear winner; if the difference is marginal for the particular case at hand, I pick what I/we know (I would actually argue that IS the best tool for the job; but in absolute 'what could happen in the future' terms it probably is not).

◧◩
24. akvadr+3K[view] [source] [discussion] 2021-12-18 08:54:51
>>threes+La
I would say postgres does much more. What use case can only Kafka handle?
25. pts_+AN[view] [source] 2021-12-18 09:39:04
>>colinc+(OP)
That's the job of a DevOps engineer not a backend developer attempted to be overworked.
◧◩
26. discor+HN[view] [source] [discussion] 2021-12-18 09:39:45
>>remram+Rp
Got a 128gb 32 core xeon workstation sitting under my desk off eBay and it was $400
replies(1): >>isbvho+W21
◧◩◪◨⬒⬓⬔
27. fanf2+ER[view] [source] [discussion] 2021-12-18 10:35:00
>>daenz+Hz
I guess the clever lock semantics are SKIP LOCKED, which is designed to support efficient queues. The cleverness is inside PostgreSQL rather than in the application, other than the cleverness of knowing about this feature. https://www.2ndquadrant.com/en/blog/what-is-select-skip-lock...
replies(1): >>tomc19+GL1
◧◩◪◨⬒
28. Dowwie+VW[view] [source] [discussion] 2021-12-18 11:45:38
>>daenz+TA
I think you're helping bring balance to the enthusiasm here for using Postgres as a multi-purpose tool. However, there is a lot of room for you and the advocates favoring Postgres to both be right about tooling. I adopted RabbitMQ because I decided I didn't want to grow into needing it by dealing with many of the problems that motivated engineers to bring RabbitMQ into existence. However, I probably would have been fine with Postgres-pubsub, or Redis-pubsub/streams, both databases that I already used for their general purpose and have established capabilities for messaging. I noticed your earlier agreement with the person who mentioned using Firebase, and Firebase is yet another multi-purpose tool good enough at many things but still not better than the customized domain systems. If you agree with the claim for Firebase, others can now agree about Supabase. It's all Postgres beneath, though.
replies(1): >>nicobu+y61
◧◩◪
29. isbvho+W21[view] [source] [discussion] 2021-12-18 12:56:28
>>discor+HN
That's not exactly a setup suitable for reliable production usage though.
◧◩◪◨⬒⬓
30. nicobu+y61[view] [source] [discussion] 2021-12-18 13:34:54
>>Dowwie+VW
Agree with your point about multiple tools being good enough, but IMO firebase is not one of them. In my experience despite it claiming to be excellent at scaling, it performs worse than even a small Postgres instance. It’s good at the “real-time subscriptions”, but that’s about it.
replies(1): >>Dowwie+Sj1
◧◩◪◨⬒
31. qetern+Yi1[view] [source] [discussion] 2021-12-18 15:28:31
>>daenz+us
No, you are misunderstanding. People are saying Postgres does message broking quite well. That makes it the right tool for the job for many people. You have a hard time believing it but people who have actually done it are saying otherwise. This is your misunderstanding.
◧◩◪◨⬒⬓⬔
32. Dowwie+Sj1[view] [source] [discussion] 2021-12-18 15:36:07
>>nicobu+y61
Noted. Thanks for sharing your experiences with that. We need to hear more about lackluster investments in tech.
◧◩◪◨⬒⬓⬔⧯
33. tomc19+GL1[view] [source] [discussion] 2021-12-18 18:16:44
>>fanf2+ER
Yup, exactly that
◧◩◪◨⬒
34. michae+gi2[view] [source] [discussion] 2021-12-18 21:57:11
>>daenz+us
There is also the issue of having to have up to n experts for n different "best tools". Programmer/devops time is expensive; the tool choice is not the only (and often the least) cost to consider.
◧◩
35. rowanG+CW6[view] [source] [discussion] 2021-12-20 16:38:48
>>macksd+n
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.
[go to top]