Fireship · @fireship
Kafka in 100 Seconds
Uploaded January 10, 2023 · Length 2:35
Summary
kafka explained in 100 seconds: a distributed event streaming platform for real-time data.
- kafka
- event streaming
- apache kafka
- real-time data
- data pipelines
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
Apache kofka a distributed event
- 0:02
streaming platform that can scale
- 0:04
massive pipelines of real-time data it
- 0:06
was created in 2011 at LinkedIn written
- 0:09
in Java and Scola and named kofka
- 0:11
because it's a system optimized for
- 0:13
writing let's imagine using it to build
- 0:14
a dashboard like Google analytics when
- 0:17
an event occurs like a website visit the
- 0:19
producer API creates a new record these
- 0:22
records are stored to disk in an ordered
- 0:24
immutable log called a topic which can
- 0:27
persist forever or disappear when no
- 0:29
longer needed top are distributed and
- 0:31
replicated in a cluster which contains
- 0:33
multiple servers called Brokers this
- 0:35
makes kofka fault tolerant and able to
- 0:37
scale to any workload on the other side
- 0:39
multiple consumers can subscribe to this
- 0:42
data they can read the most recent
- 0:43
message like AQ or read the entire topic
- 0:46
log and listen to updates in real time
- 0:48
in addition it provides a very powerful
- 0:50
streams API that can transform and
- 0:53
aggregate these topics before they ever
- 0:54
reach the consumer this all may sound
- 0:56
similar to message Brokers like rabbit
- 0:58
mq but kofka can handle more throughput
- 1:01
and is ideal for streaming data
- 1:03
applications for example it's used today
- 1:05
by companies like Lyft to collect and
- 1:07
process geolocation data Spotify and
- 1:09
Netflix for log processing and
- 1:11
cloudflare for real-time analytics to
- 1:14
get started download it and use a tool
- 1:16
like zookeeper or Kraft to manage your
- 1:18
cluster now in one terminal start
- 1:20
zookeeper then in the other start the
- 1:22
kofka server with the environment up and
- 1:24
running we can now create our first
- 1:25
topic remember a topic is just a log of
- 1:28
events kept in order in an event will
- 1:30
have a key value and timestamp and may
- 1:33
also contain optional metadata and
- 1:34
headers now let's use this command to
- 1:36
publish an event to the topic where
- 1:38
every line represents a different event
- 1:40
and now these events are written to a
- 1:42
topic which is stored durably and
- 1:44
partitioned in the cluster cofa
- 1:46
guarantees that any consumer of a given
- 1:48
topic will always read the events in the
- 1:50
exact same order now with this command
- 1:51
we're able to consume the topic by
- 1:53
default it will give us the latest event
- 1:55
although we can use the from beginning
- 1:57
flag to read the entire log it's also
- 1:59
Poss to provide an offset to read a


