zlacker

[parent] [thread] 16 comments
1. petilo+(OP)[view] [source] 2021-12-18 00:00:03
Just because something can be used to do something doesn't mean it should. Kafka is specifically designed for this purpose, it is free, and it is easy to learn and use. If "starting with Postgres and then switching out when the time comes" saves money then I can understand. Otherwise use the right tool for the right job, right from the start.
replies(5): >>Edward+C2 >>anothe+Z2 >>jastr+C3 >>static+o4 >>cp9+Xp
2. Edward+C2[view] [source] 2021-12-18 00:18:25
>>petilo+(OP)
I've been working with Kafka since 0.8, I mildly beg to differ on "easy to learn and use", just based on the fact that to use it well, you have to design your applications for its semantics, and that tuning it requires a lot of indepth understanding of its mechanics.

And I've seen a looot of bad designs and misconfigurations.

All that said, I'm a massive fan of Kafka, I'm the first to admit it's a complex tool, but it needs to be for the problem space it targets.

3. anothe+Z2[view] [source] 2021-12-18 00:20:55
>>petilo+(OP)
I've been on stage at KafkaConf demo-ing my Kafka SRE chops, and I would avoid Kafka until I am sure it is necessary.

'easy to learn and use' is a downright lie.

edit: link to this same topic being discussed a few weeks ago: https://news.ycombinator.com/item?id=28903614#28904103

4. jastr+C3[view] [source] 2021-12-18 00:26:18
>>petilo+(OP)
This is advice that seems reasonable but is actually pretty harmful.

Take a startup with a few users. The senior engineer decides they need pub/sub to ship a new feature. With Kafka, the team goes to learn about Kafka best practices, choose client libraries, and learn the Kafka quirks. They also need to spin up Kafka instances. They ship it in a month.

With postgres, they’ve got an MVP in a day, and shipped within a week.

replies(3): >>daenz+o5 >>petilo+g8 >>threes+yf
5. static+o4[view] [source] 2021-12-18 00:31:14
>>petilo+(OP)
Kafka is not a queue. Kafka's parallelism is limited by the number of partitions you allocate, and you have to be sure to avoid head of line blocking.

Not the case with a queue.

replies(3): >>jpgvm+V7 >>Spivak+Yd >>fnord7+uv
◧◩
6. daenz+o5[view] [source] [discussion] 2021-12-18 00:39:12
>>jastr+C3
I can set up an application to use AWS SQS or GCP PubSub in a day and it will scale without a second thought. I don't think it's productive to compare the worst case of scenario A and the best case of scenario B.
◧◩
7. jpgvm+V7[view] [source] [discussion] 2021-12-18 01:01:29
>>static+o4
Exactly. If you do want something very scalable that fixes these problems but shares a lot of architectural similarity with Kafka then you should check out Apache Pulsar.
◧◩
8. petilo+g8[view] [source] [discussion] 2021-12-18 01:04:52
>>jastr+C3
> With postgres, they’ve got an MVP in a day, and shipped within a week.

And the next week they realize they want reader processes to block until there is work to do. Oops that's not supported. Now you have to code that feature yourself... and soon you're reinventing Kafka.

replies(2): >>guywho+6m >>mlyle+Ru
◧◩
9. Spivak+Yd[view] [source] [discussion] 2021-12-18 01:49:11
>>static+o4
This needs to be sung from the rooftops every time Kafka is mentioned. It's an amazing tool but it is the wrong wrong wrong tool if you need a queue. It will bite you in the ass and you'll be left with someone breathing down your neck wondering why jobs are processing so slowly and why you can't just spin up more workers.
◧◩
10. threes+yf[view] [source] [discussion] 2021-12-18 02:04:04
>>jastr+C3
How does any of this equally not apply to PostgreSQL ?

Is this some magical database where you don't need to worry about access patterns, best practices or how it is deployed.

replies(2): >>KptMar+0j >>pritam+3e3
◧◩◪
11. KptMar+0j[view] [source] [discussion] 2021-12-18 02:37:43
>>threes+yf
Yes, it's that magical database, up to certain scale.
◧◩◪
12. guywho+6m[view] [source] [discussion] 2021-12-18 03:10:22
>>petilo+g8
That's where LISTEN comes in. It's very simple to write this loop perfectly correct.
13. cp9+Xp[view] [source] 2021-12-18 03:52:19
>>petilo+(OP)
> Kafka is specifically designed for this purpose, it is free, and it is easy to learn and use

I think Kafka is great, but it is absolutely not “easy to learn and use”.

◧◩◪
14. mlyle+Ru[view] [source] [discussion] 2021-12-18 04:50:23
>>petilo+g8
The very source we're talking about describes how to block until there is work to do -- listener.Listen("ci_jobs_status_channel")
◧◩
15. fnord7+uv[view] [source] [discussion] 2021-12-18 04:56:35
>>static+o4
what is "head of line" blocking?
replies(1): >>static+r92
◧◩◪
16. static+r92[view] [source] [discussion] 2021-12-18 20:15:58
>>fnord7+uv
A single partition is intended to be processed, more or less, in by a single worker. If one of those messages, for whatever reason, ends up being really expensive, or flaky, you can't move on until you've handled it.

That's head of line blocking.

◧◩◪
17. pritam+3e3[view] [source] [discussion] 2021-12-19 07:58:54
>>threes+yf
> How does any of this equally not apply to PostgreSQL ?

1. Postgres is easier to setup and run (than Kafka) 2. Most shops already have Postgres running (TFA is targeted to these shops) 3. Postgres is easier to adapt to changing access patterns (than Kafka).

----

> Is this some magical ...

Why must your adversary (Postgres) meet some mythical standard when your fighter (Kafka) doesn't meet even basic standards.

[go to top]