News for hackers. Stuff that matters.
Re:OpenTelemetry at Scale: Using Kafka to handle bursty traffic by Svenskunganka on Monday October 23, 2023 @01:40AM (#37981996)
Depending on how you use the database it is. If you write the data as well as the offset to the DB in the same transaction, you can then seek to the offset stored in the DB after application restart and continue from there.
Re:OpenTelemetry at Scale: Using Kafka to handle bursty traffic by viraptor on Monday October 23, 2023 @01:49AM (#37982031)
> after application restart and continue from there.

What if the application doesn't restart before the queue decides the message was lost and resends?

Re:OpenTelemetry at Scale: Using Kafka to handle bursty traffic by hashhar on Monday October 23, 2023 @02:27AM (#37982225)
In Kafka the "queue" is dumb, it doesn't lose messages (it's an append only durable log) nor does it resend anything unless the consumer requests it.
Re:OpenTelemetry at Scale: Using Kafka to handle bursty traffic by viraptor on Monday October 23, 2023 @03:08PM (#37990159)
There has to be a retry system somewhere, otherwise you'd end up with a 0-or-more delivery system if the app crashes after picking up from the queue, but never processing or ack-ing.
Re:OpenTelemetry at Scale: Using Kafka to handle bursty traffic by mirekrusin on Monday October 23, 2023 @01:51AM (#37982045)
You should drop "(...) and carefully acknowledging them when you are sure data is safely stored in your db (...)" part then, because it means it's not necessary, you don't rely on it.

One-or-more semantics + local deduplication gives one-and-only semantics.

In this case you're optimising local deduplication with strictly monotonic index.

One downside is that you leak internals of other system (partitions).

The other is that it implies serialised processing - you can't process anything in parallel as you have single index threshold that defines what has been and what has yet not been processed.

Re:OpenTelemetry at Scale: Using Kafka to handle bursty traffic by Svenskunganka on Monday October 23, 2023 @02:36AM (#37982258)
I'm not the one who wrote the original comment, so I can't modify it. But one should still commit offsets because it is the happy-path; DB transaction successful? Commit offset. If the latter fails due to e.g application crash and you seek at startup to the partition offset stored in the DB + 1, you get exactly-once semantics. There's some more details, e.g you'd have to do the same during consumer group rebalance, and topic configuration also plays a role, for example if the topic is a compacted topic or not, and if you write tombstones, what its retention policy is.
Re:OpenTelemetry at Scale: Using Kafka to handle bursty traffic by mirekrusin on Monday October 23, 2023 @03:20AM (#37982487)
Yes, it's good option but it requires serialised processing in partition scope, which may or may not be desirable.

If one-and-only-one semantics are needed and processing should be parallel, other methods have to be used.

Re:OpenTelemetry at Scale: Using Kafka to handle bursty traffic by robertlagrant on Monday October 23, 2023 @05:12AM (#37983283)
Presumably every exactly once processing scenario needs you to squeeze things through a serial pipe at some point, or you could have 2 messages with the same ID come in and be processed in parallel?
Re:OpenTelemetry at Scale: Using Kafka to handle bursty traffic by mirekrusin on Monday October 23, 2023 @05:45AM (#37983482)
Yes but scope/blocking/serialisation can be narrow or wide - ie. it can be per message id (highly parallel) or one for all messages of certain type/partition (not parallel).
Re:OpenTelemetry at Scale: Using Kafka to handle bursty traffic by francoismassot on Monday October 23, 2023 @02:54AM (#37982344)
Good point: first you're right, we do the ack on Kafka but it's not necessary. Second, this is not what I wanted to stress... and I should have not used the verb "acknowledge". What we do is upload the data on S3, then we commit partitions + positions in what we call the metastore. I can't edit my comment unfortunately.

> One downside is that you leak internals of other system (partitions).

True, but we generalized the concept of partitions for other datasources, pretty convenient to use it for distributing indexing tasks.

Re:OpenTelemetry at Scale: Using Kafka to handle bursty traffic by fulmicoton on Monday October 23, 2023 @04:56AM (#37983182)
> The other is that it implies serialised processing - you can't process anything > in parallel as you have single index threshold that defines what has been and > what has yet not been processed.

Fortunately Kafka is partitioned. You cannot work in parallel along partitions.

Also, you can streamline your process. If you are running your data through operation (A, B, C). (C on batch N) can run at the same time as (B on batch N+1), and (A on batch N+2)

We do both at quickwit.