Live data from Hacker News

What If We Could Rebuild Kafka from Scratch?

morling.dev

151–160 of 229 posts

Re: What If We Could Rebuild Kafka from Scratch?

#151
post #142

Earlier quoted context omitted.

It solves some issues, and creates some, since Northguard isn’t compatible with the current Kafka ecosystem. As such, you can no longer use existing software that is built on Kafka as-is. It may not be a grave concern for LinkedIn, but it could be for others that currently benefit from using the existing Kafka ecosystem.

Yeah, it's definitely a significant shift. The Xinfra component helps with Kafka compatibility, but that still has quite a bit of complexity to it. Also, it's written in C++, so that requires a different mindset to operate.

I understood Xinfra to not use the Kafka protocol as its API.

As such, even with Xinfra deployed, you have to rewrite all the software that connects to Kafka, regardless of programming language.

Re: What If We Could Rebuild Kafka from Scratch?

#152
This is a question we asked 6 years ago.

What if we wrote it in Rust. And leveraged and WASM.

We have been at it for the past 6 years. https://github.com/infinyon/fluvio

For the past 2 years we have also been building Flink using Rust and WASM. https://github.com/infinyon/stateful-dataflow-examples/

Re: What If We Could Rebuild Kafka from Scratch?

#153

Earlier quoted context omitted.

I'm not a fan or an anti-fan of kafka, but I do wonder about the hate it gets. We use it for streaming tick data, system events, order events, etc, into kdb. We write to kafka and forget. The messages are persisted, and we don't have to worry if kdb has an issue. Out of band consumers read from the topics and persist to kdb. In several years of doing this we haven't really had any major issues. It does the job we wan…

That’s my experience too. I’ve deployed it more than ten times as a consultant and never really understood the reputation for complexity. It “just works.”

I've deployed it a bunch of times and, crucially, maintained it thereafter. It's very complex, especially when troubleshooting pathological behavior or recovering from failures, and I don't see why anyone with significant experience with Kafka could reasonably claim otherwise.

Kafka is perhaps the most aptly named software I've ever used.

That said, it's rock solid and I continue to recommend it for cases where it makes sense.

Re: What If We Could Rebuild Kafka from Scratch?

#154

> Key-centric access: instead of partition-based access, efficient access and replay of all the messages with one and the same key would be desirable. I’ve been working on a datastore that’s perfect for this [1], but I’m getting very little traction. Does anyone have any ideas why that is? Is my marketing just bad, or is this feature just not very useful after all? 1. https://www.haystackdb.dev/

> HaystackDB is accessed through a RESTful HTTPS API. No client library necessary.

That's cool, but but I would prefer to not reinvent the wheel. If you have a simple library, that would already be useful.

Some simple code or request examples would be convenient as well. I really don't know how easy or difficult your interface design is. It would be cool to see the API docs.

Re: What If We Could Rebuild Kafka from Scratch?

#155

Earlier quoted context omitted.

Disclosure (given this is from Confluent): I'm ex MSK (Managed Streaming for Kafka at AWS) and my current company was competing with Confluent before we pivoted. Yup, this is one more example, just like Pulsar. There are definitely great optimizations to be made on the average case. In the case of parallel consumer, if you'd like to keep ordering guarantees, you retain O(n^2) processing time in the worst case. The is…

> traverse arbitrary dependency topologies Is there another way to state this? It’s very difficult for me to grok. > DAG Directed acyclic graph right?

Apologies, we've been so deep into this problem that we take our slang for granted :)

A graphical representation might be worth a thousand words, keeping in mind it's just one example. Imagine you're traversing the following.

A1 -> A2 -> A3...

|

v

B1 -> B2 -> B3...

|

v

C1 -> C2 -> C3...

|

v

D1 -> D2 -> D3...

|

v

E1 -> E2 -> E3...

|

v

F1 -> F2 -> F3...

|

v

...

Efficient concurrent consumption of these messages (while respecting causal dependency) would take O(w + h), where w = the _width_ (left to right) of the longest sequence, and h = the _height_ (top to bottom of the first column)

But Pulsar, Kafka + parallel consumer, Et al. would take O(n^2) either in processing time or in space complexity. This is because at a fundamental level, the underlying data storages store looks like this

A1 -> A2 -> A3...

B1 -> B2 -> B3...

C1 -> C2 -> C3...

D1 -> D2 -> D3...

E1 -> E2 -> E3...

F1 -> F2 -> F3...

Notice that the underlying data storage loses information about nodes with multiple children (e.g., A1 previously parented both A2 and B1)

If we want to respect order, the consumer will be responsible for declining to process messages that don't respect causal order. E.g., attempting to process F1 before E1. Thus we could get into a situation where we try to process F1, then E1, then D1, then C1, then B1, then A1. Now that A1 is processed, kafka tries again, but it tries F1, then E1, then D1, then C1, then B1... And so on and so forth. This is O(n^2) behavior.

Without changing the underlying data storage architecture, you will either:

1. Incur O(n^2) space or time complexity

2. Reimplement the queuing mechanism at the consumer level, but then you might as well not even use Kafka (or others) at all. In practice this is not practical (my evidence being that no one has pulled it off).

3. Face other nasty issues (e.g., in Kafka parallel consumer you can run out of memory or your processing time can become O(n^2)).

Re: What If We Could Rebuild Kafka from Scratch?

#156
post #100

Earlier quoted context omitted.

I greatly prefer redis streams. Not all the same features, but if you just need basic streams, redis has the dead simple implementation I always wanted. Not to mention you then also have a KV store. Most problems can be solved with redis + Postgres

Actually thinking about building something with Redis streams next week. Any particular advice/sharp edges/etc?

Don't, under any circumstances, let it come into contact with an untrusted network. Anyone who can connect to your Redis service gets arbitrary remote code execution.

Re: What If We Could Rebuild Kafka from Scratch?

#157
post #144

> Key-centric access: instead of partition-based access, efficient access and replay of all the messages with one and the same key would be desirable. I’ve been working on a datastore that’s perfect for this [1], but I’m getting very little traction. Does anyone have any ideas why that is? Is my marketing just bad, or is this feature just not very useful after all? 1. https://www.haystackdb.dev/

The website seems very vapid. Extraordinary claims require extraordinary evidence. Personally I see a lack of evidence here (that this vendor-locked product is better than existing freeware) and I'm going to move on.

Thanks for the honest assessment!

Re: What If We Could Rebuild Kafka from Scratch?

#158
post #149

> Key-centric access: instead of partition-based access, efficient access and replay of all the messages with one and the same key would be desirable. I’ve been working on a datastore that’s perfect for this [1], but I’m getting very little traction. Does anyone have any ideas why that is? Is my marketing just bad, or is this feature just not very useful after all? 1. https://www.haystackdb.dev/

what can you do that redis can't? I'm also skeptical of the graph on your front page that claims S3 cost as much as DynamoDB. that alone makes it look like total nonsense. as someone else said, extraordinary claims require extraordinary evidence.

> what can you do that redis can't?

Keep the data in S3 for 0.023 USD per GB-month. If you have a billion keys that can be useful.

> I'm also skeptical of the graph on your front page that claims S3 cost as much as DynamoDB.

Good point. Could have put a bit more work into that.

Re: What If We Could Rebuild Kafka from Scratch?

#159

Earlier quoted context omitted.

> traverse arbitrary dependency topologies Is there another way to state this? It’s very difficult for me to grok. > DAG Directed acyclic graph right?

Apologies, we've been so deep into this problem that we take our slang for granted :) A graphical representation might be worth a thousand words, keeping in mind it's just one example. Imagine you're traversing the following. A1 -> A2 -> A3... | v B1 -> B2 -> B3... | v C1 -> C2 -> C3... | v D1 -> D2 -> D3... | v E1 -> E2 -> E3... | v F1 -> F2 -> F3... | v ... Efficient concurrent consumption of these messages (while…

Do you have an example use case for this? This does seem like something unsuited to kafka, but I'm having a hard time imagining why you would structure something like this.

Re: What If We Could Rebuild Kafka from Scratch?

#160

> Key-centric access: instead of partition-based access, efficient access and replay of all the messages with one and the same key would be desirable. I’ve been working on a datastore that’s perfect for this [1], but I’m getting very little traction. Does anyone have any ideas why that is? Is my marketing just bad, or is this feature just not very useful after all? 1. https://www.haystackdb.dev/

Some input from previously working on a superset of this problem. And being in a similar position. Mature projects have too much bureacracy, and even spending time talking to you = opportunity cost. So making a case for why you're going to solve a problem for them is tough. New projects (whether at big companies or small companies) have 20 other things to worry about, so the problem isn't big enough. I wrote about th…

Thanks. Interesting read, and an interesting product / service. Have been thinking about the same approach myself…
Post reply on HN