Kafka · Advanced Kafka

Source vs Sink connectors

Easysource connectorsink connectorkafka connect

Interview question

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

How to answer

Source connector

External system → Kafka

Examples:

  • Postgres/MySQL → topics
  • JDBC source polling tables → topics
  • File / S3 source → topics
Output
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
Output
Kafka topics  ===sink===>  Warehouse / Search / Object storage

Together in a pipeline

Output
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 / 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."