TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Why I am not a fan of Apache Kafka

70 pointsby kornishover 8 years ago

16 comments

boredandroidover 8 years ago
This article is pretty out of date, I think the central concerns have actually been addressed.<p>It&#x27;s true that when we were working at LinkedIn Kafka tended to have much better Java support. Since founding Confluent (I&#x27;m one of the co-founders) we&#x27;ve really focused on improving the situation outside Java.<p>A few specific corrections:<p>1. We added full support for consumers with no interaction with zookeeper in the main kafka protocol. There is no longer any direct interaction with zookeeper from either the producer or consumer. We did this because we care a lot about the non-java clients.<p>2. Kafka has been extremely disciplined about backwards compatibility. The protocol comes with versioning and changes are always implemented in a way that supports both the old and new version and can be rolled out without downtime. In the five year history of the project we did one backwards incompatible release--the break from 0.5.x-0.7.x to 0.8.x. This was done intentionally to allow us to refactor the apis. I think this is a pretty good track record.<p>It&#x27;s worth also addressing why Kafka clients directly access nodes in the cluster rather than requiring a proxy layer. The reason we do this is to allow very high throughput, partition aware processing. This is really required for use cases like stream processing that need to process data efficiently, especially in cases where you are reprocessing data. You can always build a proxy layer on top of direct access but not vice versa.<p>Confluent (where I work) is doing two things that help the non-java client ecosystem: 1. We maintain an open source REST proxy that provides decoupled access (albeit with a little overhead compared to the direct clients) 2. We have picked up work on clients. We offer and fully support a c&#x2F;c++ client, a python client, and have a Go client coming soon. All of these are in feature parity with the Java clients. (More on the way).<p>Both of these efforts are open source and apache licensed and included in the open source Confluent Platform distribution of Kafka.
评论 #12537009 未加载
评论 #12534248 未加载
ah-over 8 years ago
This needs a [2015]. Back then there wasn&#x27;t a single usable client for .net.<p>Since then the non-Java clients have massively improved. In particular <a href="https:&#x2F;&#x2F;github.com&#x2F;edenhill&#x2F;librdkafka" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;edenhill&#x2F;librdkafka</a> is fantastic. There&#x27;s also <a href="https:&#x2F;&#x2F;github.com&#x2F;dpkp&#x2F;kafka-python&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dpkp&#x2F;kafka-python&#x2F;</a>, with support for consumer groups and all the other modern features.<p>The basic criticism of requiring a complex client is valid, however you cannot achieve the delivery guarantees that Kafka gives you without one. The alternative would be to have a local agent process like consul, but that wouldn&#x27;t give you the throughput that Kafka gets.<p>Disclaimer: I&#x27;ve built a C# client for Kafka based on librdkafa (<a href="https:&#x2F;&#x2F;github.com&#x2F;ah-&#x2F;rdkafka-dotnet" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ah-&#x2F;rdkafka-dotnet</a>), so I&#x27;m biased.
评论 #12533788 未加载
评论 #12533905 未加载
评论 #12533790 未加载
评论 #12533676 未加载
agentgtover 8 years ago
I think in large part why people dislike Kafka is that they don&#x27;t really need Kafka (and the complexity that comes with it).<p>Don&#x27;t get me wrong Kafka is good tech if really need that level of throughput but I honestly think most companies don&#x27;t have that much data and&#x2F;or just putting too much in the pipe. But they go with Kafka anyway I guess to &quot;CYA&quot; for future scaling only to find out Kafka is complicated.<p>I mentioned this earlier (a couple days ago <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12520159" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12520159</a>) for someone using Kafka for a logging aggregation system only to drop it for ZMQ.<p>My other point is if your endpoint isn&#x27;t fast enough it doesn&#x27;t really matter what your pipe is. Pick an easy to use pipe first (like RMQ) and worry about scaling the endpoints.
评论 #12533726 未加载
评论 #12534173 未加载
Xorlevover 8 years ago
Author doesn&#x27;t understand Kafka, doesn&#x27;t have a good client for his language, therefore doesn&#x27;t like Kafka.<p>Jay Kreps responds to a few of his points -- the complexity of the client is for scalability reasons.<p>&gt; When you Produce a Message Set onto the bus, you don&#x27;t directly get back a response telling you that the messages have successfully been persisted to one or more partitions.<p>At least in the Java client, this isn&#x27;t true. True, if you used the async API before 0.9 you weren&#x27;t able to get an ACK, but the sync producer would block until a message was published. In the new consumer, you&#x27;re handed futures + the ability to provide a callback[1].<p>[1] <a href="http:&#x2F;&#x2F;kafka.apache.org&#x2F;082&#x2F;javadoc&#x2F;org&#x2F;apache&#x2F;kafka&#x2F;clients&#x2F;producer&#x2F;KafkaProducer.html" rel="nofollow">http:&#x2F;&#x2F;kafka.apache.org&#x2F;082&#x2F;javadoc&#x2F;org&#x2F;apache&#x2F;kafka&#x2F;clients...</a>
评论 #12533751 未加载
slap_shotover 8 years ago
I work with Kafka every day and don&#x27;t really think the OP&#x27;s concerns (it&#x27;s too complex and there isn&#x27;t third party driver support to the degree of Redis) are too serious. They both will be solved with time.<p>My bigger fear is Confluent - the private company founded by many Kafka core committers and employing many Kafka committers.<p>Confluent offers open source extensions to Kafka&#x27;s core in the form of connectors (boiler plate code to connect to common sources and sinks like JDBC databases, files, and Hadoop).<p>Confluent also offers (as of right now) one closed source product extension (Control Center - a cluster monitoring system similar to the management UI of RabbitMQ, etc) that requires enterprise subscription (several thousand dollars per node per year) after a 30 day trial.<p>$30.9MM for a service&#x2F;support based company seems like a lot of money and a drives a very high valuation that needs to show return. I personally am skeptical of service&#x2F;support venture backed model[0].<p>My fear is that Kafka will increasingly require &quot;enterprise&quot; support tools with less and less support and features available to people who do not pay for enterprise support. The amount of documentation of the 0.10 release (particularly the Streams API) that resided on the Confluent page versus the Kafka page is a HUGE red flag to me.<p>I have all the respect in the world for Jay, and the Kafka&#x2F;Confluent team, but I find myself avoiding Confluent&#x27;s tools (Kafka Connect and Schema Registry) because of fear that those will eventually be closed source or require an enterprise subscription.<p>[0] I&#x27;m not an investor but I haven&#x27;t seen many these models work out in the long run. A recent Podcast by A16Z touches on this subject very well, with an A16Z partner saying he believes exactly one company has pulled this model off well at venture scale - Red Hat. <a href="http:&#x2F;&#x2F;a16z.com&#x2F;2016&#x2F;08&#x2F;19&#x2F;pricing-freemium-premium-opensource&#x2F;" rel="nofollow">http:&#x2F;&#x2F;a16z.com&#x2F;2016&#x2F;08&#x2F;19&#x2F;pricing-freemium-premium-opensour...</a>
评论 #12534239 未加载
评论 #12533859 未加载
admnorover 8 years ago
Hi. Author of the article&#x2F;gist here. It was actually written in Spring of last year, I think. I&#x27;ve just updated it because, as people have said, many of the issues have been addressed one way or the other:<p>* The KafkaREST proxy makes life a little easier * librdkafka makes life a lot easier, especially when you can just download a thin wrapper around it for your chosen language * I am no longer working at the place that chose Kafka 0.8 following no testing at all for their use case, and refused to back down through months of hell both writing code and trying to keep clusters available * The people at Confluent have done a lot of good work since then, both on Kafka itself and on various auxiliary tools&#x2F;products.<p>So yeah, I would probably look at Kafka again today if I needed that kind of functionality. Screw ZooKeeper though.
reitanqildover 8 years ago
To be honest I think very many of us don&#x27;t need Kafka. As with many other things as long as we aren&#x27;t handling more than a few thousands messages&#x2F;sec any decent ordinary nessage broker like ActiveMQ should do.<p>Caveat: do not install production message bus in a vm.<p>I recently listened to this talk which compares and explains very nicely: <a href="https:&#x2F;&#x2F;vimeo.com&#x2F;181925293" rel="nofollow">https:&#x2F;&#x2F;vimeo.com&#x2F;181925293</a>
评论 #12533664 未加载
评论 #12533844 未加载
yummyfajitasover 8 years ago
I find the complaints that Linkedin hasn&#x27;t open sourced their REST client to be a little silly. I&#x27;m in a similar situation - PHP needs to send commands into Kafka but PHP kafka libs aren&#x27;t great (or maybe there are and my PHP guys don&#x27;t want to use them).<p>So I wrote a little Thrift endpoint (in Scala) which receives messages and writes to kafka. It&#x27;s under 100 lines of code. Probably another couple of hundred lines for the PHP version of the thrift client.<p>Are we really complaining that Linkedin hasn&#x27;t open sourced their 200 loc rest client?
评论 #12533798 未加载
评论 #12533964 未加载
KirinDaveover 8 years ago
&quot;Really new&quot; around November 2015. It was released in 2011 though. It&#x27;s only 2 years younger than Redis, and is primarily an exercise in using Zookeeper.<p>It&#x27;s very surprising to hear people suggest Redis pubsub is a valid substitute for Kafka, when in fact it&#x27;s not. It has a fundamentally different set of operating characteristics, a different sweet spot. Kafka isn&#x27;t great from a consumer resumption point of view, but at least there ARE options.<p>It&#x27;s also untrue that Kafka gives no feedback on a successful message put. This is obviously a bug or design shortcoming in the post author&#x27;s chosen toolchain which is correctable, and was part of the core java toolchain as of late 2015 AFAIK.<p>I do agree that the Kafka system has an architecture that maximizes difficulty for new language bindings. Certainly C# has the tools to write an excellent implementation, assuming someone understands zookeeper well enough.
评论 #12534705 未加载
notacowardover 8 years ago
I liked &quot;behind a load balancer like a normal server&quot; the best. How does the author think a load balancer works? By making an even less accurate guess about the state of servers behind it than Kafka can do via Zookeeper. AFAICT the author is just upset that Kafka isn&#x27;t exactly like Redis, whereas most sane people would be quite glad it&#x27;s not.
hifierover 8 years ago
Seems like mostly FUD. No mention of specific issues in any clients. And please have a look at other high throughput systems (like Cassandra or VoltDB) before claiming that a load balancer is the proper way to connect clients to a distributed system.
评论 #12533675 未加载
falcolasover 8 years ago
Quick note - the author just did an update for an &quot;As Of Sept 2016&quot;.<p>TL;DR: Still not a great solution for their original problem. The development of good C&#x2F;C++ libraries means he could now get around the lack of decent C# libraries. Overall architecture still pretty f&#x27;ed.
fusiongyroover 8 years ago
I don&#x27;t have as much depth with it as the author, but I also felt like using it was kind of a bait and switch, especially coming from having read (and loved) Jay&#x27;s book I Heart Logs. We&#x27;re using it at my work but I&#x27;m not really in love with it and will probably be trading it out for AMQP for an event system we&#x27;re planning.<p>I was working with a junior engineer on this project, and he kept on getting confused about what features were ZooKeeper and which were Kafka. There are two complex technologies here as a first hurdle to using it. This isn&#x27;t ideal.<p>In the book he describes a scenario where your stream processors record to their own storage where they are in the stream, but Kafka&#x27;s stock consumers now seem to keep track of that in ZooKeeper instead, which seems like an odd place to make the decision.<p>We initially had a small Node.js server, just to experiment with, but I discovered that it had no error handling at all. I could put fake hostnames in and it would just hang out, as if eventually maybe they would appear and it could connect. This is really the Kafka driver&#x27;s fault; we switched back to Java and the Java client worked, it&#x27;s just a little overcomplex. But we also periodically came in to find the server had crashed. I still don&#x27;t know why. (I&#x27;m open to it being our general ignorance and a misconfiguration or something.)<p>In the book, Jay describes this beautiful computing model where you have these log streams and you just process them, and it&#x27;s high-level and very alluring. The actual APIs that Kafka gives you are not beautiful or intuitive. Rewinding to the beginning is something you can only do after you read, for instance. We were thinking of using it like an external write-ahead-log (as described in the book) but it just doesn&#x27;t really support that use-case directly through its API.<p>It&#x27;s kind of a shame, because AMQP doesn&#x27;t support that use case all that well. I believe you have to decide whether you want your queue to act like a round-robin affair or as a persistent queue. Kafka sort of lets you have both; streams (ostensibly) work like persistent broadcast queues. I don&#x27;t think I&#x27;ll be able to use AMQP as a write-ahead-log by itself; probably I&#x27;ll have to have some kind of mediating service that&#x27;s just recording events to persistence and have a separate way of getting historical stuff.<p>I spent a year or so unable to work on Kafka but telling everyone to read I Heart Logs, so getting in there a few months ago and seeing how wide the gap is between the beautiful theory and the practice has been disillusioning. Frankly, the actual system and the one in the book are pretty radically divergent. I am still a big fan of the system described in the book. I hope someday I get to use it.
评论 #12534269 未加载
jknoepflerover 8 years ago
The linked article now includes a giant disclaimer on top more or less retracting the view expressed in the title. Please update the title to accurately reflect the linked content. Also note that the author is mostly griping because of issues which no longer exist. I&#x27;ve posted the author&#x27;s words below:<p>&quot;Update, September 2016<p>OK, you can pretty much ignore what I wrote below this update, because it doesn&#x27;t really apply anymore.<p>I wrote this over a year ago, and at the time I had spent a couple of weeks trying to get Kafka 0.8 working with .NET and then Node.js with much frustration and very little success. I was rather angry. It keeps getting linked, though, and just popped up on Hacker News, so here&#x27;s sort of an update, although I haven&#x27;t used Kafka at all this year so I don&#x27;t really have any new information.<p>In the end, we managed to get things working with a Node.js client, although we continued to have problems, both with our code and with managing a Kafka&#x2F;Zookeeper cluster generally. What made it worse was that I did not then, and do not now, believe that Kafka was the correct solution for that particular problem at that particular company. What they were trying to achieve could have been done more simply with any number of other messaging systems, with a subscriber reading messages off and writing them to some form of persistent storage (like Elasticsearch). I&#x27;m sure there are issues of scale or whatever where Kafka makes sense.<p>It is true, as many people have pointed out in the comments, that my primary problem was the lack of a good Kafka client for .NET. If I&#x27;d been able to install a Kafka Nuget package and it had just worked, this would never have been written. But I couldn&#x27;t. Today I could probably use a thin wrapper around librdkafka, and if I ever have to work with Kafka from .NET again, that&#x27;s probably what I&#x27;ll do. C&#x2F;C++ libraries are great for stuff like that: C can talk to anything, and everything can talk to C. Yay.<p>I do understand the performance-related reasons that drove the decision to design a clever-client architecture, but it was, apparently, extremely difficult to create a good client unless you were working with either Java, or with a lower-level language such as C or Go which could work with the complex protocols and implementation requirements.<p>So, anyway, like I said, you can ignore the stuff below which was written about an old version of the software, while I was in a very bad mood. But I&#x27;m going to leave it here, in the hopes that it may serve as a warning to future developers of really complicated infrastructure components. It probably won&#x27;t, though.&quot;
thomasleeover 8 years ago
&gt; When you Produce a Message Set onto the bus, you don&#x27;t directly get back a response telling you that the messages have successfully been persisted to one or more partitions. Instead, you must also Consume the bus, and you should eventually receive multiple messages acknowledging the persistence of each message in the set.<p>Maybe this has changed recently, but IIRC this isn&#x27;t true if your ProducerRequest has the ack bit set to 1 or 2 (i.e. leader or replica acking):<p><a href="https:&#x2F;&#x2F;github.com&#x2F;confluentinc&#x2F;kafka&#x2F;blob&#x2F;79aaf19f24bb48f90404a3e3896d115107991f4c&#x2F;core&#x2F;src&#x2F;main&#x2F;scala&#x2F;kafka&#x2F;api&#x2F;ProducerRequest.scala#L60" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;confluentinc&#x2F;kafka&#x2F;blob&#x2F;79aaf19f24bb48f90...</a><p>The response&#x2F;ack is sent directly over the socket sending the request.<p>&gt; If a Node dies then a &quot;leadership election&quot; happens, ZooKeeper is updated with the new metadata, and your application must react to this and handle the changes. There&#x27;s a six second delay while this happens<p>Not that I doubt it, but not sure where six seconds comes from here ... perhaps waiting for partition leader elections? It&#x27;s been long enough that I can&#x27;t quite remember exactly what happens during a failover.<p>&gt; and who knows what happens if you try and send messages to a dead node during that time.<p>Depends how it died, which client API you&#x27;re using and how the client is configured. Some combination of:<p>* data loss if acking is disabled (hint: enable acking) * backpressure and errors in the client until new partition leaders kick in * client socket writes hanging &quot;forever&quot;<p>If the latter is surprising: no SO_SNDTIMEO in pure Java blocking socket I&#x2F;O. Think the new clients may address that, but not entirely sure.<p>As an aside: can&#x27;t emphasize enough how important it is to get your configuration right early. By the time you run into problems, it&#x27;s often too late. Pay heed to any tuning guides you can find. Talk to Confluent if you&#x27;re still unsure.<p>&gt; AND HAVE THEY OPEN SOURCED THIS MAGICAL SERVER? NO, THEY BLOODY HAVEN&#x27;T.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;confluentinc&#x2F;kafka-rest" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;confluentinc&#x2F;kafka-rest</a> this thing? FWIW, it&#x27;s kind of a joke for high throughput anyway. Last time we spoke to Confluent they sort of discouraged its use for exactly that reason.<p>Still, it&#x27;s an easy bridge for folks who aren&#x27;t too fussed about throughput. Not sure why you&#x27;d be using Kafka if throughput&#x27;s not your thing, but y&#x27;know.<p>&gt; If you are using Java&#x2F;Scala&#x2F;Clojure&#x2F;Kotlin&#x2F;whatever and can use the Official Java Client then I&#x27;m sure Kafka is a perfectly reasonable choice for a message bus, although there are plenty of others that seem to me to be far less bloody-minded.<p>Despite all the gotchas, Kafka&#x27;s capable of pretty incredible throughput in a fault-tolerant HA configuration. I can empathize with some of the frustrations, but past a certain scale the proposed alternatives just aren&#x27;t IMHO.
agounarisover 8 years ago
Why someone should be a fan of Kafka? its not the team of my town its a damn hammer.