Live data from Hacker News

Kafka as an Antipattern

joshaustin.tech

11–20 of 102 posts

Re: Kafka as an Antipattern

#11

The anti-pattern here isn't Kafka, it's using Kafka for 7,500 messages/day. Making your whole system asynchronous for that level of load is the textbook definition of over-engineering.

Sometimes you do want it to be asynchronous anyway, it just doesn't make sense to make it asychronous with a horizontally scalable distributed computing streaming platform...

Re: Kafka as an Antipattern

#12

The anti-pattern here isn't Kafka, it's using Kafka for 7,500 messages/day. Making your whole system asynchronous for that level of load is the textbook definition of over-engineering.

Exactly, handled way higher loads than that with a basic table and a poller.

Re: Kafka as an Antipattern

#13
post #9

It seems a lot of the complaints weren't about kafka itself, but rather seemed to stem from internal communication problems. Custom kafka message headers could very well be custom http headers, and the problem is the same. Kafka is just coincidental. Looking at the volume though, kafka is overkill. They most likely could have just used the database and reaped the benefits of doing everything in a single transaction,…

>small scale kafka, though. It's conceptually great to have everything work off of logs, but kafka does add a non trivial operational burden.

does something like that exist ???

Re: Kafka as an Antipattern

#14
post #10

The anti-pattern here isn't Kafka, it's using Kafka for 7,500 messages/day. Making your whole system asynchronous for that level of load is the textbook definition of over-engineering.

Yes. For perspective, that's about one message every ten seconds.

Sorry for the naivety/not obvious from the comments: is that too much or too little? (I've used RabbitMQ much more than Kafka.)

Re: Kafka as an Antipattern

#15
This is what I've been starting to think about on a more abstract level: Introducing a new technology, a new system into a design isn't like putting a piece into a jigsaw puzzle, or even worse, trying to mold and force the system to fit whatever hole your design has. Many more specialized systems - and Kafka is one of them - should solve some problem, but they should also change your mental model of the system and you should look for the easiest way to introduce these heavy hitters.

For example, if you use Kafka or streaming solutions like Flink or Spark, you should change your mental model to (possibly large), (possibly resplayable) streams of events and look for simple ways to get these event streams going and good ways to consume them. And then you need to let the design push you where it wants you to go.

Like, at work, we recently had a discussion how it was so storage-expensive for a project to store all events of a day and how the query to count all of these events per tenant was taking so long. While they are using a streaming event processor in front of it. Like, what the hell - think in streams, tally up these events on the fly and persist that every hour?

Re: Kafka as an Antipattern

#16

    Immediately starts to doubt OP's assumption/implementation of the "where it works great"
Jokes aside, agree with others. For the 7500/day, I would just push these into an S3/minio folder. And then dequeue 100 or N once every 10/30/60/T seconds. play around for the right N,T.

Then again am sure there maybe reasons/context/constraints unaware to us.

Eg - the ingestion is spiky, with the possibility of all 7500 in a few secs/minute, you would want to first make sure that the http traffic can scale before getting to the point where it can actually connect and push to the queue

Possible reason#2 - an intern who just finished up their first Kafka task; just got freed up

#3 - or this was the only infra available and a choice had to be made with the time available at hand

#4 - or this was an experiment to see for yourself

A majority may not agree with your view, but none of us really are in your shoes. So I applaud you for sharing your thoughts anyway.

Re: Kafka as an Antipattern

#17
post #10

Earlier quoted context omitted.

Yes. For perspective, that's about one message every ten seconds.

Sorry for the naivety/not obvious from the comments: is that too much or too little? (I've used RabbitMQ much more than Kafka.)

Kafka is designed to maximize scalability, millions of messages a second. It's a pain in the neck to manage if you don't need it

Re: Kafka as an Antipattern

#18
post #10

Earlier quoted context omitted.

Yes. For perspective, that's about one message every ten seconds.

Sorry for the naivety/not obvious from the comments: is that too much or too little? (I've used RabbitMQ much more than Kafka.)

Too little to need Kafka.

Re: Kafka as an Antipattern

#19
post #10

Earlier quoted context omitted.

Yes. For perspective, that's about one message every ten seconds.

Sorry for the naivety/not obvious from the comments: is that too much or too little? (I've used RabbitMQ much more than Kafka.)

Way too little to justify event-driven architecture (let alone Kafka specifically), unless you have some specialized need like very slow event processing and need to display a "message received" notification to user before the processing happens. Or you really need the retry functionality and can't handle it some other ways.

Most businesses have no (hue hue) business doing event driven architecture. There is way too much overhead for local testing and overall complexity, especially when you want to properly handle errors.

"But, every developer should be able to set up their local." Yea, great, explain to the manual QA who may be amazing but just started 3 months ago.

Re: Kafka as an Antipattern

#20
The way I think about this kind of problem is to remember that tools built to deal with huge scaling problems are generally dealing with a very complex set of variables. The tool is going to be designed to let you choose between all of those variables. There's no magic - just configuration whose complexity better matches that of your problem.

That being said, if you are not yet in a situation as complex as the one your tool is designed to deal with, there is a very good chance you will waste some time starting to use such a tool "early." You might get that time back later when you scale, you might have the right people to set up the complex tool the right way for your simple situation, but you are taking a bit of a risk. As long as you go into the situation with your eyes open I think most people end up ok. The horror stories almost always come from people who are working to fulfill needs they do not have and don't understand why their work isn't giving good ROI.

Post reply on HN