Basics Flashcards

1
Q

What is Kafka?

A

Kafka is publish subscribe messaging system rethought as a commit log service.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the components that make kafka

A
  • Kafka is Distributed
  • Composed of a cluster of severs
  • Messages broken up between the servers in the cluster
  • Has the notion of Leaders and followers
  • Partitioned
  • Logs are partitioned to fit on a server
  • The partitions enables scalability to arbitrary size by adding nodes.
  • The partitions also allows for parallelism
  • Replicated
  • Amount of replication is configurable
  • data exist on multiple servers
  • for data on N server, N-1 can fail and data is still accessable
  • kafka is a write ahead log
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Common kafka use cases

A
  • Collect Metrics
  • Aggregating logs
  • Stream Processing
  • Very good messaging system
  • Website activity tracking
  • Event sourcing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a kafka topic

A

A name you wish to give a series of messages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a kafka broker

A

An instance of kafka running on a server. Each individual server is a cluster or in kuberneties this is probably a pod

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a kafka cluster

A

Clusters is a collections of brokers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Describe Kafka partition

A
  • Topics are split into partitions
  • Partitions are strongly ordered & immutable
  • Partitions can exist on different servers/brokers
  • Partitions enable scalability
  • Partitions are always sent to the same consumer
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a consumer group

A

A consumer group is a collections of consumers/nodes. They receive every message from kafka cluster meaning if there were two groups they would both receive the same message that went into kafka.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do partitions receive messages

A

Producers assign a message to a partition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Where does a partition send the data?

A
  • A partition is always sent to the same consumer instance
  • A consumer group consumes one topic
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the characteristics of Offsets

A
  • Messages are assigned an offset in the partition
  • Consumers then track where they left off reading with the offset
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are Topics and what are their characteristics

A
  • A topic is a feed name or category
  • Messages are published to a topic
  • Name you give where you are going to send messages
  • logical naming for a group of messages
  • data for a topic is written to al relevant partitions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do Producers interact with Topics

A
  • Producers publish data to a chosen topic
  • Producers can also assign a partition within the topic
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How to Consumers interact with Topics

A

Consumers belong to a groups and each message in a topic is sent to one group member

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How are topics creates?

A
  • Can be created at the CLI
  • You can modify a topic
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are replicas?

A
  • Replicas are backups of a partition
  • Partitions are replicated across servers in a cluster
  • Replication factor is configurable
17
Q

Explain producers and their role

A

Producers job is to publish data to the cluster.
- can run in sync or async mode.
- They can decide on where the data is going to go.
- Assigning data to specific partitions.
- Can assign a message to a partition
- Producers can decide on the partitioning semantics

18
Q

Explain the consumers role

A

Consumers read the data from the cluster
- Consumers can have different characteristics
- One is called high level and another is called simple level
- simple level requires more setup allowing for the user to have more control over what the consumer does.

19
Q

Explain the role of the Brokers

A

Brokers are clustered data repositories
- Kafka cluster contains a collection of brokers
- Brokers contain partitions
- Broker structure can produce messages independently of consuming messages

Advantages:
- decouple processing from data producers
- buffer unprocessed messages
- broker structure is the reason for Kafka’s very high performance

20
Q

Explain what a cluster is

A

A cluster is a collection of brokers.
A cluster must have atleast one broker.

21
Q

What are the characteristics and functionality of high level consumers

A
  • Allows you to consume a subset of partitions
  • Abstracts away the details about offsets for the consumer