Kafka Interview Guide
Kafka Interview Guide
1. What is Kafka?
Apache Kafka is a distributed streaming platform used for building real-time data pipelines and streaming
- Real-time messaging
- Stream processing
- Event sourcing
- Log aggregation
2. Core Concepts
- **Zookeeper**: Coordinates and manages Kafka brokers (Kafka 3.0+ can run without it using KRaft mode).
- **Consumer Group**: A group of consumers that share the work of consuming records.
3. Kafka Architecture
4. Key Features
bin/zookeeper-server-start.sh config/zookeeper.properties
bin/kafka-server-start.sh config/server.properties
# Create a topic
# List topics
# Describe a topic
# Start a producer
# Start a consumer
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
</dependency>
Example:
@Autowired
8. Best Practices