08 Apache Kafka
08 Apache Kafka
Key Strengths
• Scalability: can handle increasing amounts of data
• Reliability: can absorb common failures without disrupting the service
• Low Latency: operations are fast
KAFKA BROKER
Each of 3 producers
writes 10 records on The topic will end up Each consumer will
topic mytopic with 30 records eventually read the
same 30 records
Author Large Scale Distributed Systems
Example producer pseudo-code
producer = new Producer(…); Create a producer
producer.send(“topic1”, set);
Send the message to topic topic1
Kafka cluster
0 a 123
3 c 123 5 a 12
4 b null
Tombstone: record with null value
5 a 12 to represent deletion
Materialization
TOPIC
MV
0 a 123
c 123
1 b 145
a 12
2 c 123
3 b null
4 a 12
Example with Python