Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing
Back
  1. Home
  2. Interview prep
  3. Source vs Sink connectors

Kafka · Advanced Kafka

Source vs Sink connectors

Easykafka-28
source connectorsink connectorkafka connect

Question

What is the difference between a Source connector and a Sink connector in Kafka Connect?

Solution

Source connector

External system → Kafka

Examples:

  • Debezium Postgres/MySQL CDC → topics
  • JDBC source polling tables → topics
  • File / S3 source → topics
Database / API / Files  ===source===>  Kafka topics

Sink connector

Kafka → external system

Examples:

  • JDBC / Snowflake / BigQuery sink
  • Elasticsearch sink
  • S3 / GCS sink for data lake landing
  • MongoDB sink
Kafka topics  ===sink===>  Warehouse / Search / Object storage

Together in a pipeline

Orders DB --source CDC--> topic orders.public.orders --sink--> analytics warehouse

Interview details that score points

  • Source connectors track offsets/positions (binlog file+pos, LSN, etc.).
  • Sink connectors must handle idempotency / upserts because Kafka delivery is often at-least-once.
  • Use Schema Registry + Avro/Protobuf for stable contracts between source and sink.

Interview tip: "Source imports into Kafka; sink exports out of Kafka. Connect is the framework that runs both."

PreviousNext