Slide 1

Slide 1 text

APACHE KAFKA OVERVIEW BY SUKASIT LIANG PORNRATTANA

Slide 2

Slide 2 text

QUEUE - fifty itself :* : ' 4$

Slide 3

Slide 3 text

AESSAGEQUEVE.ly / ' ' / l l I I I

Slide 4

Slide 4 text

WHY ? - SOURCE SOURCE SOURCE SOURCE SOURCE SYSTEM SYSTEM SYSTEM SYSTEM SYSTEM Tara ! . . SYSTEM SYSTEM SYSTEM SYSTEM SYSTE - . - . T - - . - USER PAYMENT NEWS I I y I - DISTRIBUTED - I - REPLICATION KAFKA ACTION I , ACTION 2 , ACTIONS # I - FAULT TOLE RENT I ANALYTICS EMAIL DATABASE - FAST SYSTEM (

Slide 5

Slide 5 text

ECOSYSTEM - KAFKA ✓ " " " " " \ KAFKA STREAMS § 987¥ En - PRODUCER ILIFFE ? ! consumer - I IT feet I -200 KEEPER

Slide 6

Slide 6 text

KAFKA us RABBIT MQ - KALIKA ( THE Lod ) RABBI-TMQCTH.li QUEUE ) - COMMIT LOG - FIRST IN , FIRST OUT - WRITE - READ - [ READER [ WRITER - APPEND - ONLY , ORDER BY TIME - STORED DATA IS TRANSIENT IN NATURE . STORED DATA IS PERSISTENT - NOT SHARED BETWEEN IN NATURE C RETAINED BY TIME ) APPLICATIONS - SHARED BETWEEN APPLICATIONS , - EXCHANGE ? # I - App i 11--1111 - APP 2

Slide 7

Slide 7 text

APACHE KAFKA

Slide 8

Slide 8 text

Topics - 1¥11 . - KEY C OPTIONAL ) - TIMESTAMP - OFFSET - PARTITION - VALUE

Slide 9

Slide 9 text

PARTIT.CN#i @ GUARANTEED ORDER TOPIC - ONLY WITHIN PARTITION go OFFSET e - I WEEK RETENTION PARTITION ¢ TI4 / PARTITION i µfI' ¥7 .IT?TyTEe , PARTITION 2 - hi PA : ¥970 ¥ PARTITION L OFFSET O OFFSET ONLY REFERS TO A SPECIFIC PARTITION

Slide 10

Slide 10 text

BROKERS - - BOOTSTRAP SERVERS - I I BROKER I . - DNA BROKER 273Mt BROKER 3 - - - TOPIC I TOPIC I TOPLCL PARTITION 0 PARTITION L PARTITION 2 PIE : fond I path : :{ Toni ftp.wmm-ihftottnoaf.sn.AEoiee.se . %) - A BROKER HAS OWN ID - INTERNAL IMPLEMENTATION - 3 BROKERS AT LEAST - NOT DOCUMENTED

Slide 11

Slide 11 text

REPLICATION FACTOR - A- 1. CREATES 2 COPIES OF PARTITIONS REPLICATION FACTOR = 21 2. ELECTED A LEADER PARTI TONG AND PARTITION =L By ZOOKEEPER BROKER 't FACE BROKERED * BROKER 3 * TOPIC I ftp.ITOPLCI TOPIC I * PARTITION Of T PARTITION 01 PARTITION I CA -1205£ IN - SYNC TOPIC I REPLL PARTITION I IF A SERVER ⑥ TOLERATE Up TO N - 1 IS DOWN ? Ne REPLICATION FACTOR

Slide 12

Slide 12 text

IFA BROKER IS DOWN ? - BROKER 2 ~ BROKER 2 :& ' Topper AT TOPIC ' n ¥AEij# ' PARTITION L PARTITION 't BROKERS a ⇐i±mIE¥tom BROKER 2 Diii * BROKER 's TOPIC I TOPIC I in 2 . 3 REPLICAS PARTITION Of ⑤ PARTITION 't 9 AT LEAST TOPIC I f' ! PARTITION I ¥ X

Slide 13

Slide 13 text

PRODUCERS - tacks ACK 's = O } IIT / PRODUCER - BROKER ✓ ✓ i ✓ ACKS . 1 SOURCE PRODUCER KAFKA / PRODUCER → BROKER - LEADER ✓ SYSTEMS - ACK 's . all MESSAdEK~# P¥TeapER# key : cost key : cus . a PARTITION of REPLICA PARTITION I key : cus -2 -

Slide 14

Slide 14 text

CONSUMERS if MAX i NOE PARTITIONS - PARTITION 4 E' E ' El - Ant - El - i is JW PARTITION I He EI ✓ # y KAFKA CONSUMER g-Y-grff.tn ; PARTITION 2 ④ → 2,45 - no key : cus -1 key : cus -1 key : cus -2 ] t I €4 ¥4 # key : cus -2 key : cus -3

Slide 15

Slide 15 text

CONSUMER GROUPS # GROUPS BROKEN # ④ El El patron " nor " : ;; : :/ ↳ PARTITION '' 7%97,31! ④ #fAR" Tt ONZ GROUP 't ④ ④ REBALANCE tYY¥8"w Groups ' OFFSET

Slide 16

Slide 16 text

ZOOKEEPER You ,sHAkNoT Pass ! ! - STILL AWAKE ? O \ - HB⇒E3 EEEo I IT S 'T , NENG O HEY , BROKER'd ! ! BROKERL JUST DIED YOU ARE THE LEADER ! \ I ex TO # " * " *

Slide 17

Slide 17 text

MESSAGE DELIVERY SEMANTICS - AT MOST ONCE - MESSAGES MAY BE LOST BUT ARE NEVER DELIVERED FAST / MAY BE LOST AT LEAST ONCE - MESSAGES ARE NEVER LOST BUT MAY BE REDELIVERED SAF E/MAY BE DUPLICATED EXACTLY ONCE - EACH MESSAGE IS DELIVERED ONCE AND ONLY ONCE VERY DIFFICULT TO ACHIEVE ) NEED STRONG ENGINEERING

Slide 18

Slide 18 text

QSA