tkati-node-dedup — streaming deduplication node
Reads batches from a Kafka input topic, drops events that are duplicates of an
event seen on the same field within a rolling processing-time window, and
writes the deduplicated batch to a configurable output. Duplicate state is
tracked in an embedded, on-disk RocksDB store local to this process — no
external dedup service is required.
Configuration
Settings are loaded from a TOML file. Set the SETTINGS_FILE environment
variable to point to it (defaults to settings.toml).
[input]
type = "kafka"
[input.connection]
broker = "redpanda:29092"
[input.topic]
name = "raw_event"
[input.topic.schema]
uid = "string"
time = "timestamp[ms]"
# … other columns
[input.consumer]
group_id = "node-dedup-group"
batch_size = 1000
batch_timeout_sec = 10
auto_offset_reset = "latest"
[output]
type = "kafka"
[output.connection]
broker = "redpanda:29092"
[output.topic]
name = "raw_event_deduped"
[dedup]
field = "uid" # column in input.topic.schema to dedup by
window_hours = 3 # rolling dedup window
bucket_hours = 1 # on-disk bucket granularity (effective window is
# window_hours .. window_hours + bucket_hours)
store_dir = "/var/lib/tkati-node-dedup/store"
Output and DLQ follow the same OutputSettings shape as tkati-node-el
("kafka" or "clickhouse") — see that package's README for the full
connection/table config shape.
Delivery & dedup guarantees
Delivery: at-least-once. Offsets are committed only after (1) the
filtered batch is produced and confirmed delivered (produce_arrow followed
by a blocking flush), and (2) the surviving keys are durably written to the
current RocksDB bucket. If the process crashes between steps, the same input
batch is re-read at restart; because the keys from a completed produce are
already marked seen, re-processing that batch is a no-op (or reproduces only
the genuinely-new subset) rather than losing data.
On any internal dedup-store failure — a bucket won't open, a lookup errors, a disk I/O error — the node treats the event as NOT a duplicate and forwards it. This node will occasionally forward a duplicate it should have caught, but will never silently drop a real event because of dedup-store trouble.
The window is approximate, not exact. Because state is bucketed in
bucket_hours increments (default 1h) rather than a true sliding window, the
effective dedup window is between window_hours and
window_hours + bucket_hours. Stale buckets are deleted from disk
automatically once they fall outside the window — checked once per iteration,
so state never grows unbounded.
Bucketing is by processing time, not any timestamp field in the event payload — an event's bucket is when this node handles it, not when it happened upstream.
IMPORTANT: dedup state is local to this process
The RocksDB store lives on local disk at store_dir and is not shared
between instances. Running multiple concurrent instances of this node against
the same input topic (e.g. multiple consumers in the same consumer group, or
multiple replicas) will not dedup correctly across instances unless the
input is partitioned such that all events sharing a field value are always
routed to the same instance (e.g. Kafka partitioning keyed on field, one
node instance per partition or partition subset it exclusively owns). Running
this node with more parallelism than that will let duplicates leak through
across instance boundaries. This is a direct consequence of choosing an
embedded local-file store instead of a shared external one — evaluate this
tradeoff before scaling this node horizontally.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tkati_node_dedup-0.3.0.tar.gz.
File metadata
- Download URL: tkati_node_dedup-0.3.0.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
360035551d5f08c4656a643cafe64b955256b4b9abc5f3be419b4b8a1f9964fa
|
|
| MD5 |
e85806fe49cd4f37d95deddcc37b0f38
|
|
| BLAKE2b-256 |
5dff25c71b979d1ce218ffff0409a818891fe6d111e6ad25feff5f11ccd97daa
|
Provenance
The following attestation bundles were made for tkati_node_dedup-0.3.0.tar.gz:
Publisher:
publish-tkati-node-dedup.yml on epoch8/tkati
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tkati_node_dedup-0.3.0.tar.gz -
Subject digest:
360035551d5f08c4656a643cafe64b955256b4b9abc5f3be419b4b8a1f9964fa - Sigstore transparency entry: 2531131964
- Sigstore integration time:
-
Permalink:
epoch8/tkati@ca48bdca2036de2e681c150ed9f32ff146be0731 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/epoch8
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-tkati-node-dedup.yml@ca48bdca2036de2e681c150ed9f32ff146be0731 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tkati_node_dedup-0.3.0-py3-none-any.whl.
File metadata
- Download URL: tkati_node_dedup-0.3.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32b6db813cfb3e1b6cd80a0486bbf4b5ab8f0ccba08917366bb8c8e5fc3c9922
|
|
| MD5 |
c6f312aa733fdd75a1408e96162a985f
|
|
| BLAKE2b-256 |
87ec8fde7812a85a5af2937e75b7509d6788caf8b494049dfc64a7af33864477
|
Provenance
The following attestation bundles were made for tkati_node_dedup-0.3.0-py3-none-any.whl:
Publisher:
publish-tkati-node-dedup.yml on epoch8/tkati
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tkati_node_dedup-0.3.0-py3-none-any.whl -
Subject digest:
32b6db813cfb3e1b6cd80a0486bbf4b5ab8f0ccba08917366bb8c8e5fc3c9922 - Sigstore transparency entry: 2531132031
- Sigstore integration time:
-
Permalink:
epoch8/tkati@ca48bdca2036de2e681c150ed9f32ff146be0731 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/epoch8
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-tkati-node-dedup.yml@ca48bdca2036de2e681c150ed9f32ff146be0731 -
Trigger Event:
push
-
Statement type: