Quick revision
The short answer
In distributed mode, Kafka Connect runs as a group of worker processes that share a group.id and coordinate through Kafka; each connector is a configured job split into up to tasks.max tasks spread across the workers, and converters turn Connect data into bytes and back. The workers share three compacted internal topics for configs, source offsets and statuses. Source connectors store their own positions in the offsets topic, while sink connectors use an ordinary consumer group, connect-<name>, and everything is managed through the REST API on port 8083.
What to remember
In this answer, we saw that distributed Connect is a group of workers coordinating through Kafka, running connectors that split their work into tasks, with converters turning Connect data into bytes. The workers share three internal topics for configs, source offsets and statuses. Source connectors keep their own positions in the offsets topic, sink connectors use the consumer group connect-<name>, and the REST API on port 8083 creates, checks and restarts connectors. Standalone mode suits development; distributed mode is for production.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
In distributed mode, Kafka Connect runs as a group of worker processes that share a group.id and coordinate through Kafka; each connector is a configured job split into up to tasks.max tasks spread across the workers, and converters turn Connect data into bytes and back. The workers share three compacted internal topics for configs, source offsets and statuses. Source connectors store their own positions in the offsets topic, while sink connectors use an ordinary consumer group, connect-<name>, and everything is managed through the REST API on port 8083.
Why this question is asked
Kafka Connect is how most companies move data between Kafka and databases, search clusters and object storage without writing producers and consumers by hand. When a pipeline breaks, the questions are always the same: which worker runs this task, where is it reading from, and how do we restart it safely. Interviewers ask this question to check that we know the moving parts well enough to answer those. In this answer, we will go through workers, connectors, tasks and converters, look at the three internal topics, see where source and sink offsets live, and then create, check and restart a connector through the REST API.
1Workers, Connectors and Tasks
A worker is a JVM process running the Connect runtime. In distributed mode we start several workers with the same group.id, and they find each other through Kafka using the same group protocol consumers use, so there is no separate coordination service. One worker becomes the leader and assigns work.
A connector is a configured job, for example a JDBC source reading the orders table, defined by a name, a connector class and settings. The connector does not move data itself. It splits the work into tasks, up to tasks.max of them, such as one task per table or a share of the topic partitions. Tasks do the actual copying, and the leader spreads them across workers. When a worker joins or leaves, the group rebalances and tasks move, which is how Connect scales and survives a lost worker.
Converters sit between Connect and Kafka. Connectors work with Connect's own data model (a schema and a value), and a converter such as JsonConverter or an Avro converter serializes that to bytes for Kafka, or the reverse for a sink. Converters are set per worker with key.converter and value.converter and can be overridden per connector.
- REST API on each workerport 8083: create, check, restart connectors
- Connectornamed job, splits work into up to
tasks.maxtasks - Tasks on workersdo the copying; rebalanced when workers join or leave
- ConvertersConnect data <-> bytes (JSON, Avro, Protobuf)
- Internal topics in Kafkaconfigs, source offsets, statuses, shared by the group
5 layers, from the top down. Step through them one at a time.
2The Three Internal Topics
Because workers are stateless processes, Connect keeps its own state in Kafka. Every worker in a group points at the same three topics, set in the worker configuration.
The config topic must have exactly one partition, because the order of config changes matters and only a single partition preserves it. The offsets and status topics may have several partitions. All three are compacted, so the latest value for each key is kept forever. Two different Connect clusters must never share these topics, or they would read each other's connectors.
3Where Source and Sink Offsets Live
Source and sink connectors remember their position in very different ways, and this difference matters whenever we need to rewind or skip data.
A source connector reads from an external system, so its position is in that system's terms: a MySQL binlog file and position, a PostgreSQL log sequence number, or the last timestamp a JDBC query saw. The task returns this with each record as two small maps, the source partition (what is being read, such as a table name) and the source offset (how far). The worker periodically writes them to the offsets topic, and on restart the task asks for its last offset and continues from there.
A sink connector reads from Kafka, so it simply uses a consumer group. By default the group is named connect- plus the connector name, for example connect-orders-sink, and its offsets live in __consumer_offsets like any other consumer's. That means kafka-consumer-groups.sh can show its lag.
| Connector type | Position looks like | Stored in |
|---|---|---|
| Source (e.g. JDBC, Debezium) | {table: orders} -> {ts: 2026-11-12T10:00Z} | offset.storage.topic |
| Sink (e.g. JDBC, S3) | partition 2 -> offset 48,120 | __consumer_offsets, group connect-<name> |
| Standalone mode (any) | same maps as source | local file offset.storage.file.filename |
4Creating, Checking and Restarting a Connector
Every worker exposes the same REST API, and any worker forwards requests to the leader when needed. These three calls cover most daily work.
We prefer PUT on /config over POST /connectors because it creates the connector if it does not exist and updates it if it does, which suits automation. Notice that the status call shows the connector and each task separately: a connector can be RUNNING while one of its tasks is FAILED, and a failed task does not restart by itself. The restart call with includeTasks=true and onlyFailed=true restarts just the broken tasks, leaving healthy ones alone.
5Standalone Versus Distributed Mode
Standalone mode runs a single worker, takes connector configs from properties files on the command line, and stores source offsets in a local file. It is quick to start and good for development or a one-off copy on a laptop, but if that process or its disk is lost, the work stops and the offsets may be lost. Distributed mode stores everything in Kafka, spreads tasks across workers and moves them when a worker fails, which is what we run in production.
6Follow-up questions
What do the stop endpoint and the offsets endpoints in newer Connect versions allow?
PUT /connectors/{name}/stop, added in Kafka 3.5, stops a connector and shuts down its tasks while keeping its configuration, unlike pause, which keeps tasks allocated. GET /connectors/{name}/offsets shows a connector's offsets, and from 3.6 a stopped connector's offsets can be changed with PATCH or reset with DELETE on the same path. This lets us rewind or skip data, for source and sink connectors alike, without editing internal topics or using consumer group tools.
What does pause do compared with stop?
Pause tells the tasks to stop processing but keeps them assigned to workers and keeps their resources. Stop shuts the tasks down entirely, which is the state required before altering offsets.
Can tasks.max be higher than the work available?
It can be set higher, but the connector decides how many tasks to create. A sink reading a topic with 4 partitions gets no benefit from 10 tasks, because a partition is read by only one task at a time.
7Conclusion
In this answer, we saw that distributed Connect is a group of workers coordinating through Kafka, running connectors that split their work into tasks, with converters turning Connect data into bytes. The workers share three internal topics for configs, source offsets and statuses. Source connectors keep their own positions in the offsets topic, sink connectors use the consumer group connect-<name>, and the REST API on port 8083 creates, checks and restarts connectors. Standalone mode suits development; distributed mode is for production.
Open with
In distributed mode I run several workers, which are JVM processes with the same group.id; they coordinate through Kafka the way a consumer group does, and one of them leads and assigns work.
Then, if they want more
A connector is a named, configured job, and it splits its work into up to tasks.max tasks, which the leader spreads over the workers and rebalances when workers join or leave. Converters sit between Connect's data model and Kafka bytes, for example JSON or Avro, set per worker and overridable per connector.
The workers share three internal topics: config.storage.topic, with a single partition and compaction, holds connector configs; offset.storage.topic holds source offsets; status.storage.topic holds connector and task states. Source and sink offsets are stored differently.
A source connector saves its own position in the external system, like a binlog position or last timestamp, as source partition and source offset maps in the offsets topic. A sink connector just uses a consumer group, connect- followed by the connector name, with offsets in __consumer_offsets.
To manage connectors I use the REST API on port 8083: PUT /connectors/name/config to create or update, GET /connectors/name/status to see connector and task state with error traces, and POST /connectors/name/restart with includeTasks and onlyFailed to restart failed tasks. Standalone mode is a single worker with offsets in a local file, fine for development.
About this answer
- Last updated
- 13 November 2026
- Versions it names
- Kafka 3.5
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Apache Kafka documentation
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Explain the parts of a Kafka Connect deployment in distributed mode: workers...": https://scrivio-interview-library.netlify.app/spring-boot/kafka-streams-connect/f213e8b208/