Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Lightweight and Fault-tolerant: Using compacted...
Search
Elizabeth Giles
June 14, 2018
Technology
0
95
Lightweight and Fault-tolerant: Using compacted topics as a source of truth
Deck presented at the June 2018 Toronto Kafka meetup
Elizabeth Giles
June 14, 2018
Tweet
Share
Other Decks in Technology
See All in Technology
会社紹介資料 / Sansan Company Profile
sansan33
PRO
15
400k
ClickHouseはどのように大規模データを活用したAIエージェントを全社展開しているのか
mikimatsumoto
0
270
AWS DevOps Agent x ECS on Fargate検証 / AWS DevOps Agent x ECS on Fargate
kinunori
2
140
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
210
顧客との商談議事録をみんなで読んで顧客解像度を上げよう
shibayu36
0
310
生成AIと余白 〜開発スピードが向上した今、何に向き合う?〜
kakehashi
PRO
0
150
マネージャー視点で考えるプロダクトエンジニアの評価 / Evaluating Product Engineers from a Manager's Perspective
hiro_torii
0
180
M&A 後の統合をどう進めるか ─ ナレッジワーク × Poetics が実践した組織とシステムの融合
kworkdev
PRO
1
500
今こそ学びたいKubernetesネットワーク ~CNIが繋ぐNWとプラットフォームの「フラッと」な対話
logica0419
5
450
【Oracle Cloud ウェビナー】[Oracle AI Database + AWS] Oracle Database@AWSで広がるクラウドの新たな選択肢とAI時代のデータ戦略
oracle4engineer
PRO
2
180
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
2
760
コンテナセキュリティの最新事情 ~ 2026年版 ~
kyohmizu
6
1.8k
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
780
Building AI with AI
inesmontani
PRO
1
710
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Paper Plane
katiecoart
PRO
0
46k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
150
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
117
110k
WENDY [Excerpt]
tessaabrams
9
36k
From π to Pie charts
rasagy
0
130
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
170
Transcript
Lightweight and Fault-tolerant: Using compacted topics as a source of
truth Elizabeth Giles · PagerDuty
Context The Problem of Backpressure Compacted Topics Our Solution
None
Ingestion Service Processing Service Ingestion Service Ingestion Service Processing Service
Processing Service Event Event Event Event Event
Context The Problem of Backpressure Compacted Topics Our Solution
Ingestion Service Processing Service Ingestion Service Ingestion Service Processing Service
Processing Service Event Event Event Event Event Event Event Event Event Event Event Event Event Event Event
Ingestion Service Processing Service Ingestion Service Ingestion Service Processing Service
Processing Service Event Event Event Event Event Event Event Event Event Event Event Event Event Event Event Processing Service Ingestion Service HELP!!!
Ingestion Service Processing Service Ingestion Service Ingestion Service Processing Service
Processing Service Event Event Event Event Event Event Event Event Event Event Event Event Event Event Event Processing Service Ingestion Service Customer: Acme Age: 5 minutes Customer: Acme Age: 0 minutes Throttle: Customer: Acme For: 10 minutes To: 20 events/minute
Context The Problem of Backpressure Compacted Topics Our Solution
What happens to Kafka data?
--config cleanup.policy=delete
Topic > Partition > Log Segment > Message
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 segment.bytes=4, roll.ms=10 1 byte
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 4 bytes segment.bytes=4, roll.ms=10
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 10 ms segment.bytes=4, roll.ms=10 4 bytes
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 10 ms segment.bytes=4, roll.ms=10 10 ms 4 bytes
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 Current Segment segment.bytes=4, roll.ms=10 10 ms 10 ms 4 bytes
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 segment.bytes=4, roll.ms=10 S4 S3 S2 S1
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=delete, retention.bytes=4 S4 S3 S2 S1
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=delete, retention.bytes=4 S4 S3 S2 S1
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=delete, retention.bytes=4 S4 S3 S2
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=delete, retention.ms=10 S4 S3 S2 S1
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=delete, retention.ms=10 S4 S3 S2 S1
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=delete, retention.ms=10 S4
--config cleanup.policy=compact
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=compact S4 S3 S2 S1
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=compact S4 S3 S2 S1 Clean Dirty Uncleanable Cleanable
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=compact S4 S3 S2 S1 Clean Key Last Offset “a” 7 “d” 6
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=compact S4 S3 S2 S1 Key Last Offset “a” 7 “d” 6
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=compact S4 S3 S2 S1 Key Last Offset “a” 7 “d” 6
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=compact S4 S3 S2 S1 Key Last Offset “a” 7 “d” 6
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=compact S4 S3 S2 S1 Key Last Offset “a” 7 “d” 6
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=compact S4 S3 S2 S1 Key Last Offset “a” 7 “d” 6
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=compact S4 S3 S2 S1 Key Last Offset “a” 7 “d” 6
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=compact S4 S1
Offset 1 2 3 6 7 Key “b” “f” “c”
“d” “a” Value 2 3 4 7 8 Time 1 2 3 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=compact S4 S1
segment.bytes=4, roll.ms=10, cleanup.policy=compact, cleaner.min.cleanable.ratio=0.5 Clean Dirty Clean Dirty Clean Dirty
Clean Dirty
segment.bytes=4, roll.ms=10, cleanup.policy=compact, cleaner.min.cleanable.ratio=0.5 Clean Dirty Clean Dirty Clean Dirty
Clean Dirty
segment.bytes=4, roll.ms=10, cleanup.policy=compact, cleaner.min.cleanable.ratio=0.5 Clean Dirty Clean Dirty Clean Dirty
Clean Dirty
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=compact, cleaner.min.compaction.lag.ms=20 S4 S3 S2 S1
Offset 0 1 2 3 4 5 6 7 Key
“a” “b” “f” “c” “d” “a” “d” “a” Value 1 2 3 4 5 6 7 8 Time 0 1 2 3 4 25 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=compact, cleaner.min.compaction.lag.ms=20 S4 S3 S2 S1
Offset 1 2 3 5 6 7 Key “b” “f”
“c” “a” “d” “a” Value 2 3 4 6 7 8 Time 1 2 3 25 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=compact, cleaner.min.compaction.lag.ms=20 S4 S3 S1
Offset 0 1 2 3 4 5 6 7 8
9 Key “a” “b” “f” “c” “f” “d” “a” “c” “d” “a” Value 1 2 3 4 null 5 6 null 7 8 Time 0 1 2 3 4 5 25 6 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=compact, cleaner.delete.retention.ms=20 S4 S3 S2 S1
Offset 0 1 2 3 4 5 6 7 8
9 Key “a” “b” “f” “c” “f” “d” “a” “c” “d” “a” Value 1 2 3 4 null 5 6 null 7 8 Time 0 1 2 3 4 5 25 6 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=compact, cleaner.delete.retention.ms=20 S4 S3 S2 S1
Offset 0 1 2 3 4 5 6 7 8
9 Key “a” “b” “f” “c” “f” “d” “a” “c” “d” “a” Value 1 2 3 4 null 5 6 null 7 8 Time 0 1 2 3 4 5 25 6 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=compact, cleaner.delete.retention.ms=20 S4 S3 S2 S1
Offset 1 7 8 9 Key “b” “c” “d” “a”
Value 2 null 7 8 Time 1 6 36 37 segment.bytes=4, roll.ms=10, cleanup.policy=compact, cleaner.delete.retention.ms=20 S4 S3 S1
So… what’s the point?
Context The Problem of Backpressure Compacted Topics Our Solution
Ingestion Service Processing Service Ingestion Service Ingestion Service Processing Service
Processing Service Event Event Event Event Event Event Event Event Event Event Event Event Event Event Event Processing Service Ingestion Service Customer: Acme Age: 5 minutes Customer: Acme Age: 0 minutes Throttle: Customer: Acme For: 10 minutes To: 20 events/minute
Requirements: 1. Processing service can create throttles 2. Ingestion service
can use throttles 3. Resilience to loss of throttle data
Compacted Topics!
Requirements: 1. Processing service can create throttles 2. Ingestion service
can use throttles 3. Resilience to loss of throttle data
What about...
Ingestion Service Processing Service Event Event Event Event Event
Ingestion Service Processing Service Event Event Event Event Event Throttle
Ingestion Service Processing Service Event Event Event Event Event Throttle
Throttle Throttle
Ingestion Service Processing Service Event Event Event Event Event Throttle
Throttle Throttle Throttle
Questions?