Live data from Hacker News

Kafka at the low end: how bad can it get?

broot.ca

91–100 of 144 posts

Re: Kafka at the low end: how bad can it get?

#91

What do people recommend? Especially for low levels of load, that doesn't require that the dispatcher and consumer are written in the same language.

I use Temporal ( https://temporal.io/ )

temporal has been pretty nice and feature rich compared to rabbitmq, DB, kafka.

Re: Kafka at the low end: how bad can it get?

#92

What do people recommend? Especially for low levels of load, that doesn't require that the dispatcher and consumer are written in the same language.

Until you hit scale, the database you're already using is fine. If that's Postgres, look up SELECT FOR UPDATE SKIP LOCKED. The major convenience here - aside from operational simplicity - is transactional task enqueueing. For hosted, SQS or Google Cloud Tasks. Google's approach is push-based (as opposed to pull-based) and is far and above easier to use than any other queueing system.

How could I solve the problem of in-order processing based on a key using skip locked? Basically all records having the key to be processed one after other.

Re: Kafka at the low end: how bad can it get?

#93
post #29

What do people recommend? Especially for low levels of load, that doesn't require that the dispatcher and consumer are written in the same language.

Kafka. If your load is low enough for the problem described in the article to happen, your load is low enough that it's not an issue.

I'm not sure you understood the article. You can have a very low load but each task on your queue takes a while to process, in which case you want fair distribution of work.

Re: Kafka at the low end: how bad can it get?

#94
post #69

Earlier quoted context omitted.

Why does everybody keep missing this point? I don’t know.

There's a wonderful Kafka Children's book that I always suggest every team I work with read: https://www.gentlydownthe.stream/ The way I describe Kafka is, "an event has transpired... sometimes you care, and choose to take an action based on that event" The way I describe RabbitMQ is, "there's a new ticket in the lineup... it needs to be grabbed for action or left in the lineup... or discarded" Definitely not perfect…

Your two-sentence description is excellent. That book, not so much.

Re: Kafka at the low end: how bad can it get?

#95

Kafka for small message volumes is one of those distinct resume-padding architectural vibes.

I needed to synchronize some tables between MS SQL Server and PostgreSQL. In the future we will need to add ClickHouse database to the mix. When I last looked, the recommended way to do this was to use Debezium w/Kafka. So that is why we use it. Data volume is low.

If anybody knows of a simpler way to accomplish this, please do let me know.

Re: Kafka at the low end: how bad can it get?

#96

The kafka protocol is a distributed write ahead log. If you want a job queue you need to build something on top of that, it’s a pretty low level primative.

Not for long. An early access version of KIP-932 Queues for Kafka will be released in 4.0 in a few weeks.

https://cwiki.apache.org/confluence/display/KAFKA/KIP-932%3A...

Re: Kafka at the low end: how bad can it get?

#97

Earlier quoted context omitted.

You haven't seen the worst of it. We had to implement a whole kafka module for a SCADA system because Target already had unrelated kafka infrastructure. Instead of REST API or anything else sane (which was available), ultra low volume messaging is now done by JSON objects wrapped in kafka. Peak incompetence.

We did something similar using RabbitMQ with bson over AMQP, and static message routing. Anecdotally, the design has been very reliable for over 6 years with very little maintenance on that part of the system, handles high-latency connection outage reconciliation, and new instances are cycled into service all the time. Mostly people that ruminate on naive choices like REST/HTTP2/MQTT will have zero clue how the probl…

> Anecdotally, I think of Java as being a deprecated student language (one reason to avoid Kafka in new stacks), but it is still a solid choice in many use-cases. Sounds like you might be too smart to work with any team. =3

Honestly from reading this it seems like you’re the one who is too smart to work with any team.

Re: Kafka at the low end: how bad can it get?

#98
post #92

Earlier quoted context omitted.

Until you hit scale, the database you're already using is fine. If that's Postgres, look up SELECT FOR UPDATE SKIP LOCKED. The major convenience here - aside from operational simplicity - is transactional task enqueueing. For hosted, SQS or Google Cloud Tasks. Google's approach is push-based (as opposed to pull-based) and is far and above easier to use than any other queueing system.

How could I solve the problem of in-order processing based on a key using skip locked? Basically all records having the key to be processed one after other.

Work jobs in the order they were submitted within a partition key. This selects the next partition key that isn't locked. You could make it smarter to select a subset of the jobs checking for partition keys where all of the rows are still unlocked.

  SELECT
  * 
  FROM jobs 
  WHERE partition_key = (
    SELECT partition_key 
    FROM jobs 
    ORDER BY partition_key 
    LIMIT 1
    SKIP LOCKED
  )
  ORDER BY submitted_at
  FOR UPDATE SKIP LOCKED;

Re: Kafka at the low end: how bad can it get?

#99

What do people recommend? Especially for low levels of load, that doesn't require that the dispatcher and consumer are written in the same language.

Pulsar. Works extremely well as both a job queue and a data bus. We have been using it in this application for half a decade now with no serious issues. I don't understand why it doesn't get more popular attention.

Even StreamNative is effectively abandoning Pulsar and going all-in on the Kafka protocol. I can see the theoretical benefits of Pulsar, but it just doesn’t seem to have the ecosystem momentum to compete with the Kafka juggernaut.

Re: Kafka at the low end: how bad can it get?

#100
post #18
post #2

thankfully early access for KIP-932 is coming in 1-3 weeks as the 4.0.0 release gets published

First time I've heard of KIP-932 and it looks very good. The two biggest issues IMO are finding a good Kafka client in the language you need (even for ruby this is a challenge) and easy at-least-once workers. You can over partition and make at-least-once workers happen (if you have a good Kafka client), or you use an http gateway and give up safe at-least-once. Hopefully this will make it easier to build an at-least-…

Couldn’t agree more - the most exciting thing about KIP-932 is how much easier it’ll become to build a good HTTP push gateway.

Uber wrote a Kafka push gateway years ago, when it was considerably harder to do well: https://www.uber.com/blog/kafka-async-queuing-with-consumer-...

Post reply on HN