Catalogue / segment-2017-dedupe

Segment's Kafka and RocksDB de-duplication stage for events clients retry against the public API

Segment, 2017. De-duplication system for events ingested through the public API.

Organisation
Segment
Evidence
Reported from production
Source
Delivering billions of messages exactly once

Twilio Blog, published 2017-06-29

Records

Decision#d1

Replace Memcached check-and-set de-duplication with Kafka-partitioned workers keeping keys in local RocksDB on disk

Decision#d2

Bound each RocksDB database by size, not by a fixed time window, and delete the oldest keys explicitly

Decision#d3

Treat the Kafka output topic as the source of truth and repair RocksDB from it after a crash

Decision#d4

Key de-duplication on a message id, usually a client-generated UUIDv4, instead of vector clocks or sequence numbers

Decision#d5

Protect worker state with EBS snapshots and move drives between instances instead of running hot replicas

Sign in to read what was chosen, what was rejected and what it cost, each with its place in the source. An account is free. The job-queue cards are open without one.