► What should I test next? ► AWS is expensive - Infra Support Fund: buymeacoffee.com/antonputra ► Benchmarks: th-cam.com/play/PLiMWaCMwGJXmcDLvMQeORJ-j_jayKaLVn.html&si=p-UOaVM_6_SFx52H
Great video! Could you do a comparison between Go and Swift? They're both compiled languages that can be used for backend, but Go is super minimalistic, while Swift feels more like Rust with its rich feature set. Would love to see how they stack up against eack other.
My company uses RabbitMQ as our communication backbone for an IOT-type deployment right now, so this is actually super interesting to see Also, I might have a PR - it looks like you're instantiating a connection for every RabbitMQ consumer, when Rabbit generally prefers that you try to use only one connection and multiple channels to dole out multiple logical connections to the broker. There might be performance to gain/some wasted CPU resources there, depending on how many individual consumers you're actually constructing
Definitely, the way of setting up connection & channels on RabbitMQ may have an impact on this performance test. Although, I know Kafka beats RabbitMQ in high loads of requests
Thank you for the videos, very useful Would love to see some kind of websocket benching for number of connections and throughput with go, rust, js, erlang/elixir
I don’t know about rabbit MQ streams, but the catch with things like Redis streams and even NATS is that you can process things out of order on the same partition or message subject if you have multiple consumers which makes it a non starter for a lot of projects As always, thanks for making these videos :)
Probably caused by NATS and Redis not having partitions. You can emulate partition behavior in NATS though using subject patterns, but in contrast to Kafka the clients don't rebalance automatically for you, so you need to make a conscious decision which consumer is supposed to consume from which "partition".
So, I do feel your comparison and wording is a bit misleading. Since both can be clustered Its not a true apples to apples comparison. Now although we do know Kafka can push more due to the way it is designed. Rabbit can handle 50k msgs per second on a single node - ive tested and seen that. But it also depends on the node specs. However when you cluster, which is what most people would do (HA, reliability and scalability) - then we can see a really good test. Although I do get having the single nodes - but that should really be said. Since its not rabbit vs kafka - its a single rabbit and kafka node vs eachother - since both are designed to be clustered
IME, RabbitMQ is a better choice when your messages are spread over a large number of queues/topics to which many distinct clients subscribe. It can't beat Kafka on throughput on a single queue on a single node, but IME Kafka can, in principle, manage many topics, but doesn't like it - it may unexpectedly crash nodes. If you scale your RabbitMQ cluster dynamically, based on node load, you can a humongous number of queues shared by an equally humongous number of clients with zero problems. Then again, my experience with both is a bit dated.
This channel keeps getting better and better! Kinda my breakfast companion at this time. A bit curious, do you have Indonesian or south east asia parents? Due to the "Putra" last name.
Why you test Rabbit MQ with option keep msg memory but Kafka written to disk? That's is not fair. Can you test RabbitMQ ( Amazon MQ in AWS) with config mode lazy( written to disk).
It would also be excellent to see a comparison when using production best practices, being 3 replications and min isr of 2. Not sure if rabbit mq streams has an analogue but it would be really interesting if so
What you have in Kafka which is quite essential for many due to security is the append only and immutable lugs, the fact that they are stored to disk also retains the documents even in case of a crash. So for a banking system etc it is very important that you know the last transaction and that it isn't lost. RabbitMQ is more for less serious workloads, maybe in a web application backend but nothing I would use for anything that needs security.
I'm not sure what exactly you imply by "security", but if you think that the data in Kafka is somehow tamper-proof due to append-only immutable logs, that's not entirely true. Anyone with access to storage can modify the data and there is no mechanism in Kafka that can protect against intentional tampering with data. RabbitMQ can also be configured to persist the data on disk, and unlike Kafka, it actually supports transactions. Albeit if you need *distributed* transactions ActiveMQ and its derivatives might suit you better. Anyway, if you're looking for ultimate security, neither Kafka nor RabbitMQ will qualify on their own.
It would be interesting to see how these two cope with slow consumers or consumer outages. One of the advantages of Kafka or Redpanda is the ability to accommodate differences in speed of processing between producer and consumer.
@AntonPutra Thank you so much for this great content. Could you do a benchmark comparison between Kafka, RabbitMq Streams and Nats Jeststream? Thank you in advance.
Did you bind stream into large queues setup or something else? I mean the kind of topology configuration that could affect the test? It seems to be weird as we easily handled 1kk message workload (RabbitMQ) with binary protocol client and there was a spot to get more. The all results are to be reasonable and expected (Kafka is definitely has maturity on a stream processing) but the numbers should be higher.
Comparing the performance for which one is better i think not suitable. It is more sense when as a solution architect or developer to decide which broker you will choose as your solution for specific project requirement and if choose one of its you know at what time you need to scale and estimating additional cost.
could you compare redwood and kafka and all other and give them points in term of specific points (like throughput , from 0 to 10) , and also a general winner when we add all the points from all metrics. This could be an interesting form of benchmark
Nice compare. But now I really curious about how topic(s) are created in Kafka. I found num.partitions=1 in Kafka config, if topic created without explicit number of partitions it basically mean single thread for producer/consumer.
i have a topic and single partition per producer/consumer pair just for the test - github.com/antonputra/tutorials/blob/main/lessons/218/client/kafka/producer.go#L31
Not sure this tells you very much. Kafka and RabbitMQ guarantees are very different. Sure, if you are OK to lose data by holding it in memory, go for RabbitMQ. If you can't, then RabbitMQ will be a dumb choice. While it is interesting to see what happens when CPU usage reaches 100%, it's not a safe place to be.
@@AntonPutra of course. What I meant was - kafka can perform much better in cluster mode over rabbitmq in cluster mode. You're right, it's different case
For these tests to be more meaningful, I believe you should use clustered versions of these services. And additionally test what happens when one of the broker nodes dies.
Absolutely, thanks already for spending the time and money to do this test. Just in case, I don’t think you need 3 super big nodes, but you can do smaller nodes, but 3 brokers instead.
I frankly don’t get the obsession with using Kafka for everything. Yes, you can scale it to much higher throughput, and sometimes it’s beneficial to have long-term data persistence. But not only do you get it at the expense of much higher I/O, significantly higher CPU usage, greater latency, and setup complexity, but you’re also losing so much advanced functionality if you don’t need that scale. Advanced message routing, transactions, support for different protocols, RPC-style messaging - if you need any of these and choose Kafka “just in case” you’ll need to scale your application to infinity and beyond, well, good luck implementing it all on the client!
Now you've got me wanting to write a message broker :/ I'm guessing there are a ton of tricks to improve stability and throughout which would be fun to explore.
@@AntonPutra As long as my knowledge helps me kafka cluster is active-active, means load and data is distributed between its nodes according to topic partitions and each partition has a different leader in cluster but rabbitmq cluster is meant for HA (active-passive cluster). a replica of master node is there so if something bad happens for master node the replica node takes its place (May be im wrong but if im correct then kafka cluster is Way stronger than a rabbitmq cluster)
try to simulate consumers scaling up and down during operations ... looks like RabbitMQ works good in this cloud scenario, but kafka stuck on rebalancing
the requests per second ramp too quickly - i think that once you hit 100% cpu and the latency is building up, all you're doing is increasing the size of an internal queue - you can see that most clearly with rabbitMQ how the ram consumed just shoots through the roof - your requests per second are just being fired off without consideration of the response. once you are sending more requests than can be answered in 1 second, the completed requests per second should stop going up, even if you are sending more.
Unfortunately this test is flawed: it does not show completely what use case is, 99% of the time you'll use both for different use cases, not for performance itself. If you use Kafka/RabbitMQ for performance, simply sending/receiving then you probably doing this wrong. As a result, this is essentially comparing apples vs oranges. RabbitMQ has superstream, introduced not very long time ago, which is close to Kafka in way how it works, but it still not Kafka, it does not have Kafka guarantees and replication of data (replication is random and can't be changed by anything or key). Moreover, rabbit and kafka can be tuned for performance, but still - use case is a king here, you probably will sacrifice some capabilities that you need.
► What should I test next?
► AWS is expensive - Infra Support Fund: buymeacoffee.com/antonputra
► Benchmarks: th-cam.com/play/PLiMWaCMwGJXmcDLvMQeORJ-j_jayKaLVn.html&si=p-UOaVM_6_SFx52H
Похоже Elixir так и не дождемся
Great video! Could you do a comparison between Go and Swift? They're both compiled languages that can be used for backend, but Go is super minimalistic, while Swift feels more like Rust with its rich feature set. Would love to see how they stack up against eack other.
Golang vs Node Kafka consumer
would be very nice to add NATS to this comparison
@@slavapol-v1553 мы fastapi ждем уже полжизни
I think a battle between NATS and Kafka would be a good continuation of this comparison.
Kafka vs redpanda 😊
Yes, NATS please
Nats please
yes NATS Jetstream comparison please
Hell yeah I thought I was the only one who liked NATS
NATS vs KAFKA vs Pulsar vs AutoMQ should be a great addition to this series. This will be helpful for a lot of audience.
+1 For pulsar
And +1 for NATS
Try comparison with NATS
like
Hello, just come through a few videos of you and I LOVE them immediately. Seeing moving charts and benchmark stuff made me happy
thank you!
My company uses RabbitMQ as our communication backbone for an IOT-type deployment right now, so this is actually super interesting to see
Also, I might have a PR - it looks like you're instantiating a connection for every RabbitMQ consumer, when Rabbit generally prefers that you try to use only one connection and multiple channels to dole out multiple logical connections to the broker. There might be performance to gain/some wasted CPU resources there, depending on how many individual consumers you're actually constructing
Definitely, the way of setting up connection & channels on RabbitMQ may have an impact on this performance test. Although, I know Kafka beats RabbitMQ in high loads of requests
Redpanda vs kafka would be an interesting test
I agree. This would be a very interesting comparison
We're using redpanda in prod for our workload. Would love to see this comparison
Yesssss!
Redpanda does not delivery what it promised, but there was a Problem with journaling File system in the past...
As usual, great video. I never expected you to add a face cam, but it gives your videos a bit more personality, good job!
Nice, please try NATS
Would love to see IBM message queue as well
Thank you for the videos, very useful
Would love to see some kind of websocket benching for number of connections and throughput with go, rust, js, erlang/elixir
This is a good idea. This would be interesting to see
Thanks for a video.
Can we also check Kafka vs Redpanda?
I don’t know about rabbit MQ streams, but the catch with things like Redis streams and even NATS is that you can process things out of order on the same partition or message subject if you have multiple consumers which makes it a non starter for a lot of projects
As always, thanks for making these videos :)
Probably caused by NATS and Redis not having partitions. You can emulate partition behavior in NATS though using subject patterns, but in contrast to Kafka the clients don't rebalance automatically for you, so you need to make a conscious decision which consumer is supposed to consume from which "partition".
Would love to see comparison of kafka against NATS and/or redpanda
soon
Love this, I would also love to see NATS thrown into the mix.
So, I do feel your comparison and wording is a bit misleading.
Since both can be clustered
Its not a true apples to apples comparison.
Now although we do know Kafka can push more due to the way it is designed.
Rabbit can handle 50k msgs per second on a single node - ive tested and seen that.
But it also depends on the node specs.
However when you cluster, which is what most people would do (HA, reliability and scalability) - then we can see a really good test.
Although I do get having the single nodes - but that should really be said.
Since its not rabbit vs kafka - its a single rabbit and kafka node vs eachother - since both are designed to be clustered
IME, RabbitMQ is a better choice when your messages are spread over a large number of queues/topics to which many distinct clients subscribe. It can't beat Kafka on throughput on a single queue on a single node, but IME Kafka can, in principle, manage many topics, but doesn't like it - it may unexpectedly crash nodes. If you scale your RabbitMQ cluster dynamically, based on node load, you can a humongous number of queues shared by an equally humongous number of clients with zero problems. Then again, my experience with both is a bit dated.
This channel keeps getting better and better! Kinda my breakfast companion at this time.
A bit curious, do you have Indonesian or south east asia parents? Due to the "Putra" last name.
Yes!🎉 Glad you got your talented hands on queues finally :) great job. Can't wait to see benchmarks of Apache Pulsar, NATS and RedPanda
Why you test Rabbit MQ with option keep msg memory but Kafka written to disk? That's is not fair. Can you test RabbitMQ ( Amazon MQ in AWS) with config mode lazy( written to disk).
It would also be excellent to see a comparison when using production best practices, being 3 replications and min isr of 2. Not sure if rabbit mq streams has an analogue but it would be really interesting if so
I have to +1 asking for the NATS v. kafka test next!
ok
What you have in Kafka which is quite essential for many due to security is the append only and immutable lugs, the fact that they are stored to disk also retains the documents even in case of a crash. So for a banking system etc it is very important that you know the last transaction and that it isn't lost.
RabbitMQ is more for less serious workloads, maybe in a web application backend but nothing I would use for anything that needs security.
I'm not sure what exactly you imply by "security", but if you think that the data in Kafka is somehow tamper-proof due to append-only immutable logs, that's not entirely true.
Anyone with access to storage can modify the data and there is no mechanism in Kafka that can protect against intentional tampering with data.
RabbitMQ can also be configured to persist the data on disk, and unlike Kafka, it actually supports transactions. Albeit if you need *distributed* transactions ActiveMQ and its derivatives might suit you better.
Anyway, if you're looking for ultimate security, neither Kafka nor RabbitMQ will qualify on their own.
It would be interesting to see how these two cope with slow consumers or consumer outages. One of the advantages of Kafka or Redpanda is the ability to accommodate differences in speed of processing between producer and consumer.
Please do a SQLite3 vs MySQL2 vs Postgres next. Thank you!
Comparing two different AMQP message brokers such as RabbitMQ and LavinMQ would be really helpful. LavinMQ writes to disk as well, similar to Kafka
It would be interesting to see Apache Kafta VS Apache Pulsar!
will do soon!
Great job. My deducation after video is this, Kafka is too big to start but perfect for the large scale in case of long term.
yes, Kafka requires a lot of maintenance in production. if you have a large cluster, you may need a dedicated person just to keep it up and running
Thank U. Can you compare cluster of kafka and rabbit.
well, maybe in the future. it's quite expensive, and you can scale both messaging systems horizontally based on the load...
You should include NATS
yes soon
@@AntonPutraCLOUD NATIVE 💪
@AntonPutra
Thank you so much for this great content.
Could you do a benchmark comparison between Kafka, RabbitMq Streams and Nats Jeststream?
Thank you in advance.
Please add comparase with NATS
So my take from this is running a bunch of rabbitMQ instances with a load balancer might be a more efficient and cost effective solution then kafka.
In this configuration you have single point of failure while Kafka brokers distribute load across cluster without it.
@@efimovv okay, maybe I m missing more on kafka architecture but I guess if you really want rabbitmq you can find a way
@@sPanKyZzZ1 Sure, if someone want to use RMQ it will use despite of any tests :)
Love your videos!
Great video! I hope you will try Kafka vs. Nats!! Can I ask you how much you spent on this test?
If RMQ uses default settings - RMQ use some sort of "swap" for messages (which works ugly). It need to make some changes into config.
Did you bind stream into large queues setup or something else? I mean the kind of topology configuration that could affect the test? It seems to be weird as we easily handled 1kk message workload (RabbitMQ) with binary protocol client and there was a spot to get more.
The all results are to be reasonable and expected (Kafka is definitely has maturity on a stream processing) but the numbers should be higher.
Comparing the performance for which one is better i think not suitable. It is more sense when as a solution architect or developer to decide which broker you will choose as your solution for specific project requirement and if choose one of its you know at what time you need to scale and estimating additional cost.
could you compare redwood and kafka and all other and give them points in term of specific points (like throughput , from 0 to 10) , and also a general winner when we add all the points from all metrics.
This could be an interesting form of benchmark
are you referring to redpanda vs kafka? I would also be interested in seeing that
Nice vídeo, it could be nice to compare also RabbitMQ vs Amazon SNS, SQS vs Azure service bus. Thank you 😄
ok will do :)
How about a comparison between time-series databases for the next videos? Like InfluxDB vs. TimescaleDB. :)
In RabbitMQ each queue is bound to one cpu core, did you publish to many queues or to just one queue, it makes a lot of difference
i created kafka topic/rabbitmq queue for each producer/consumer pair so a lot
I would love to see a comparison between Kafka and Redpanda. Redpanda is a drop in Kafka replacement in C++.
(I work at Redpanda)
I would love timescaleDB vs clickhouse and to make sense of clickbench.
Beautiful video, best job, sugar.! 😊
thank you, very interesting
Would like to see kafka vs redpanda
Nice compare.
But now I really curious about how topic(s) are created in Kafka. I found num.partitions=1 in Kafka config, if topic created without explicit number of partitions it basically mean single thread for producer/consumer.
i have a topic and single partition per producer/consumer pair just for the test - github.com/antonputra/tutorials/blob/main/lessons/218/client/kafka/producer.go#L31
Please compare NATS and Kafka
ok
Could you also include redpanda and NATS?
Not sure this tells you very much. Kafka and RabbitMQ guarantees are very different.
Sure, if you are OK to lose data by holding it in memory, go for RabbitMQ. If you can't, then RabbitMQ will be a dumb choice.
While it is interesting to see what happens when CPU usage reaches 100%, it's not a safe place to be.
Nice! What is the dashboard where you have your plots set up in?
Kafka vs Redpanda? NATs at some point would also be cool
ok noted!
I think RabbitMQ streams matches better with Kafka Streams over usual Kafka. And no words said about kafka partitions count
well i have only 1 kafka broker 😊 you can only scale throughput if your partitions located on different brokers
@@AntonPutra of course. What I meant was - kafka can perform much better in cluster mode over rabbitmq in cluster mode. You're right, it's different case
Dude I love your videosss
For these tests to be more meaningful, I believe you should use clustered versions of these services. And additionally test what happens when one of the broker nodes dies.
true, but it's quite expensive. I'll see if I have the budget for it in the future
Absolutely, thanks already for spending the time and money to do this test.
Just in case, I don’t think you need 3 super big nodes, but you can do smaller nodes, but 3 brokers instead.
Thank you. This is very useful reference information.
Can you compere pulsar with kafka?
НУ НАКОНЕЦ ТО! )))
Excellent content as always!!
If possible, could you do Kafka vs ActiveMQ in a future video?
ok will do
I know it is barely used by anyone, but I'm curious how Pulsar will perform.
Me too !
Worse than NATS and Kafka from the benchmarks I’ve seen.
NATS vs Kafka would be a really interesting battle
FastAPI benchmarks pls!
ok :)
I wonder how this will go with the new GraalVM image for kafka.
I frankly don’t get the obsession with using Kafka for everything.
Yes, you can scale it to much higher throughput, and sometimes it’s beneficial to have long-term data persistence.
But not only do you get it at the expense of much higher I/O, significantly higher CPU usage, greater latency, and setup complexity, but you’re also losing so much advanced functionality if you don’t need that scale.
Advanced message routing, transactions, support for different protocols, RPC-style messaging - if you need any of these and choose Kafka “just in case” you’ll need to scale your application to infinity and beyond, well, good luck implementing it all on the client!
true, but it's very popular and almost all large companies use kafka in some form
please compare fastapi and golang (gin)
Would it be possible to do Laravel vs Next.js (or any JavaScript framework) next time?
Thanks!
thank you!!
Great stuff🎉
Can you do Kafka vs Pulsar?
Thanks in advance ☺️
You should do NATS
will do
Please compare Pulsar and Kafka
I’d live to see ZeroMQ vs Kafka. zmq claims to be the fastest message broker
Please do kafka vs nsq
ok added to my list
Now you've got me wanting to write a message broker :/ I'm guessing there are a ton of tricks to improve stability and throughout which would be fun to explore.
What about using a cluster of kafka brokers because no one will use a single instance of kafka in real production environments
you can scale both by increasing number of brokers, this gives you a baseline for single broker/node
@@AntonPutra As long as my knowledge helps me kafka cluster is active-active, means load and data is distributed between its nodes according to topic partitions and each partition has a different leader in cluster but rabbitmq cluster is meant for HA (active-passive cluster). a replica of master node is there so if something bad happens for master node the replica node takes its place (May be im wrong but if im correct then kafka cluster is Way stronger than a rabbitmq cluster)
Kafka vs Red Panda vs NATS vs Apache Pulsar 🙏
your videos all heplfull
Please add Nats and Redpanda to the mix
helo bro, can you compare laravel with some other framework thx
please add pulsar and nats too
ok
nice work
Anton putra please
fast api vs node js 23.. vs deno 2..
What about BullMQ?
Redis queue vs RabbitMQ should be interesting.
redis queue?
Before even watching Kafka is going to "win".
Source: my own experience
well, yeah, except for latency and more advanced routing 😊
try to simulate consumers scaling up and down during operations ... looks like RabbitMQ works good in this cloud scenario, but kafka stuck on rebalancing
kafka vs redpanda vs nats please!!
yes i'll do nats soon
Eclipse Mosquitto vs EMQX
Yo, interesting comparison
Test redpanda pls
Kafka vs pulsar vs Artemis
the requests per second ramp too quickly - i think that once you hit 100% cpu and the latency is building up, all you're doing is increasing the size of an internal queue - you can see that most clearly with rabbitMQ how the ram consumed just shoots through the roof - your requests per second are just being fired off without consideration of the response.
once you are sending more requests than can be answered in 1 second, the completed requests per second should stop going up, even if you are sending more.
Nats vs Kafka
will do soon
Kafka and RabbitMQ are used in different scenarios. It's kind of apples and oranges
RabbitMQ Streams are basically Kafka
There is a difference between RabbitMQ and RabbitMQ Streams
@@toTheMuh yeah, and he is testing both
What the difference?
How much did it cost?
i'm too afraid to log into my aws account again 😂
kafka vs automq!
Benchmarking guru
Unfortunately this test is flawed: it does not show completely what use case is, 99% of the time you'll use both for different use cases, not for performance itself. If you use Kafka/RabbitMQ for performance, simply sending/receiving then you probably doing this wrong. As a result, this is essentially comparing apples vs oranges. RabbitMQ has superstream, introduced not very long time ago, which is close to Kafka in way how it works, but it still not Kafka, it does not have Kafka guarantees and replication of data (replication is random and can't be changed by anything or key). Moreover, rabbit and kafka can be tuned for performance, but still - use case is a king here, you probably will sacrifice some capabilities that you need.
Nats Jetstream vs Kafka!!!!
java is trash in backend, people need to write networks tools with efficiency and scalability in mind, and for that Go or Rust are the go to
Pulsar vs Kafka
noted