Live data from Hacker News

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

broot.ca

31–40 of 144 posts

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

#31

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.

* Redis pub/sub

* Redis streams

* Redis lists (this is what Celery uses when Redis backend is configured)

* RabbitMQ

* ZeroMQ

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

#32

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

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.

> for a SCADA system

for Ignition?

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

#33
post #31

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.

* Redis pub/sub * Redis streams * Redis lists (this is what Celery uses when Redis backend is configured) * RabbitMQ * ZeroMQ

This. If you have really small volume like this article describes, just use Redis.

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

#34
Having never actually used this platform before, does anybody know why they named it Kafka, with all the horrible meanings?

Per Wiktionary, Kafkaesque: [1]

1. "Marked by a senseless, disorienting, often menacing complexity."

2. "Marked by surreal distortion and often a sense of looming danger."

3. "In the manner of something written by Franz Kafka." (like the software language was written by Franz Kafka)

Example: Metamorphosis Intro: "One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin. He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections. The bedding was hardly able to cover it and seemed ready to slide off any moment. His many legs, pitifully thin compared with the size of the rest of him, waved about helplessly as he looked." [2]

[1] Wiktionary, Kafkaesque: https://en.wiktionary.org/wiki/Kafkaesque

[2] Gutenberg, Metamorphosis: https://www.gutenberg.org/cache/epub/5200/pg5200.txt

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

#35
post #19
post #16

Earlier quoted context omitted.

Famious last words. There are database as a queue antipattern warnings about this.

Why is that an anti-pattern? Databases have added `SKIP LOCKED` and `SELECT FOR UPDATE` to handle these use cases. What are the downsides?

as with everything, it depends on how you're processing the queue.

eg we built a system at my last company to process 150 million objects / hour, and we modeled this using a postgres-backed queue with multiple processes pulling from the queue.

we observed that, whenever there were a lot of locked rows (ie lots of work being done), Postgres would correctly SKIP these rows, but having to iterate over and skip that many locked rows did have a noticeable impact on CPU utilization.

we worked around this by partitioning the queue, indexing on partition, and assigning each worker process a partition to pull from upon startup. this reduced the # of locked rows that postgres would have to skip over because our queries would contain a `WHERE partition=X` clause.

i had some great graphs on how long `SELECT FOR UPDATE ... SKIP LOCKED` takes as the number of locked rows in the queue increases, and how this partiton work around reduced the time to execute the SKIP LOCKED query, but unfortunately they are in the hands of my previous employer :(

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

#37

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.

> for a SCADA system for Ignition?

Probably Wonderware

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

#38
post #34

Having never actually used this platform before, does anybody know why they named it Kafka, with all the horrible meanings? Per Wiktionary, Kafkaesque: [1] 1. "Marked by a senseless, disorienting, often menacing complexity." 2. "Marked by surreal distortion and often a sense of looming danger." 3. "In the manner of something written by Franz Kafka." (like the software language was written by Franz Kafka) Example: Met…

Jay Kreps liked Kafka’s writing.

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

#39
post #20
post #15

Earlier quoted context omitted.

SQS, Azure Service Bus, RabbitMQ, ActiveMQ, QPID, etc… any message broker that provides the competing consumer pattern. though I’ll say having managed many of these message brokers myself, it’s definitely better paying for a managed service. They’re a nightmare when you start running into problems.

If you're using .NET I have to plug https://particular.net/ Nservicebus from particular.net. It's great at abstracting away the underlying message broker and provides an opinionated way to build a distributed system.

.Net SRE here, please no. Take 5 minutes to learn your messaging bus SDK and messaging system instead of yoloing some library that you don't understand. It's really not that hard.

Also, ServiceControl, ServiceInsight and ServicePulse are inventions of developers who are clearly WinAdmins who don't know what modern DevOps is. If you want to use that, you are bad and should feel bad.

(Sorry, I have absolute rage around this topic)

EDIT: If you insist, use MassTransit (https://masstransit.io/)

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

#40
post #13

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.

Cloud Tasks is one of the most undervalued tools in the GCP ecosystem, but mostly because PubSub gets all the attention. I've been using it since it was baked in the AppEngine and love it for 1-to-1 queues or delayed job handling.

how do you recommend working with Cloud Tasks?

raw dogging gcloud? Terraform? or something more manageable?

I've been curious for one of my smaller projects, but I am worried about adopting more GCPisms.

Post reply on HN