Skip to content
Apache Kafka kf getting-started 5 min read

The Kafka Ecosystem

Apache Kafka started life as a distributed commit log, but in production you almost never run it alone. A rich ecosystem has grown around the broker to solve the recurring problems of moving data in and out, processing streams, governing message formats, and operating the platform reliably. Knowing what each piece does — and when to reach for it versus writing your own client — is the difference between gluing brittle scripts together and shipping a maintainable streaming platform.

The big picture

Think of Kafka as the central nervous system. The broker stores and serves events; everything else either feeds events in, drains them out, transforms them in flight, or keeps the data trustworthy. The diagram below shows how the major components fit around the core.

                +-------------------+
   Sources ---> |  Kafka Connect    | ---> Sinks (DB, S3, ES)
   (DB, APIs)   |   (source/sink)   |
                +---------+---------+
                          |
                    +-----v-----+        +------------------+
                    |  Brokers  | <----> | Schema Registry  |
                    |  (KRaft)  |        |  (Avro/Proto/JSON)|
                    +-----+-----+        +------------------+
                          |
              +-----------+-----------+
              |                       |
        +-----v------+        +-------v--------+
        | Kafka      |        |   ksqlDB       |
        | Streams    |        | (SQL on streams)|
        +------------+        +----------------+

Components at a glance

ComponentPurposeWhen to use it
Kafka ConnectDeclarative ingest/egress via reusable connectorsMove data between Kafka and external systems without custom code
Kafka StreamsJVM library for stateful stream processingEmbed transformations, joins, and aggregations inside your app
Schema RegistryCentral store + compatibility checks for message schemasEnforce contracts across producers and consumers
ksqlDBSQL engine over Kafka topicsBuild streaming pipelines and materialized views with SQL
MirrorMaker 2Cross-cluster replicationDR, migration, and geo-distribution of topics
Managed servicesHosted Kafka (Confluent, MSK, Aiven, Redpanda)Offload operations, scaling, and patching

Kafka Connect — integration without code

Kafka Connect is a framework for streaming data between Kafka and other systems using pre-built connectors. Source connectors pull data into Kafka; sink connectors push it out. You configure connectors as JSON and submit them to the Connect REST API — no producer or consumer code required. Connect runs in distributed mode for fault tolerance, spreading connector tasks across a worker cluster.

{
  "name": "postgres-source",
  "config": {
    "connector.class": "io.debezium.connector.postgresql.PostgresConnector",
    "database.hostname": "db.internal",
    "database.dbname": "orders",
    "topic.prefix": "cdc",
    "plugin.name": "pgoutput"
  }
}
curl -X POST http://localhost:8083/connectors \
  -H "Content-Type: application/json" \
  -d @postgres-source.json

Prefer Connect over hand-rolled integration code whenever a maintained connector exists. Debezium for change data capture, the S3 sink, and the JDBC connectors cover a huge share of real-world needs and handle offsets, retries, and exactly-once semantics for you.

Kafka Streams — processing in your app

Kafka Streams is a Java library (not a separate cluster) for building stateful processing directly inside your application. It reads from topics, transforms records, and writes results back, with local state stores backed by changelog topics for fault tolerance. Because it is just a dependency, it deploys like any other Spring Boot service.

@Configuration
public class TopologyConfig {

    @Bean
    public KStream<String, Order> ordersStream(StreamsBuilder builder) {
        KStream<String, Order> orders = builder.stream("orders");
        orders.filter((key, order) -> order.amount() > 100)
              .to("high-value-orders");
        return orders;
    }

    public record Order(String id, double amount) {}
}

For ad-hoc transformation or simple routing, Streams is far lighter than standing up a separate processing cluster.

Schema Registry — trustworthy data

As topics gain producers and consumers, a shared understanding of message structure becomes critical. Schema Registry stores Avro, Protobuf, or JSON Schema definitions, assigns each a version, and enforces compatibility rules so a producer cannot ship a change that breaks downstream consumers. Serializers register schemas automatically and embed a compact schema ID in each message.

spring.kafka.producer.value-serializer=io.confluent.kafka.serializers.KafkaAvroSerializer
spring.kafka.properties.schema.registry.url=http://localhost:8081
spring.kafka.properties.auto.register.schemas=true

Set the subject compatibility level (for example BACKWARD) so new schema versions can be read by consumers still on the old one.

ksqlDB — SQL on streams

ksqlDB lets you build streaming applications using SQL instead of code. You define streams and tables over topics and write continuous queries that run forever, emitting results to new topics or serving lookups via materialized views.

CREATE STREAM high_value_orders AS
  SELECT order_id, amount
  FROM orders
  WHERE amount > 100
  EMIT CHANGES;

It is ideal for analysts and quick pipelines, though heavy stateful workloads often graduate to Kafka Streams.

MirrorMaker 2 — replication across clusters

MirrorMaker 2, built on Kafka Connect, replicates topics, consumer offsets, and ACLs between clusters. Use it for disaster recovery, active/active geo-distribution, or migrating between clusters (including on-prem to cloud) with minimal downtime.

Managed and alternative offerings

Running Kafka yourself means owning broker upgrades, partition rebalancing, and capacity planning. Managed services trade some control for operational relief:

OfferingNotes
Confluent CloudFull ecosystem (Connect, ksqlDB, Schema Registry) as a managed SaaS
AWS MSKManaged Kafka tightly integrated with AWS IAM, VPC, and CloudWatch
Aiven for Apache KafkaMulti-cloud managed Kafka with a generous open-source posture
RedpandaKafka API-compatible broker in C++ with no JVM and no ZooKeeper

Redpanda is an alternative implementation rather than a managed Kafka — it speaks the same protocol, so existing clients and tools work unchanged, while aiming for lower latency and simpler operations.

Best Practices

  • Reach for Kafka Connect before writing custom integration code; maintained connectors handle offsets, retries, and delivery guarantees.
  • Adopt Schema Registry early and enforce a compatibility policy so schema evolution never breaks consumers.
  • Use Kafka Streams for stateful logic that belongs inside a service, and ksqlDB for SQL-friendly pipelines and prototypes.
  • Run Connect and MirrorMaker in distributed mode so connector and replication tasks survive worker failures.
  • Evaluate managed offerings honestly — the cost of self-operating brokers (upgrades, scaling, on-call) is usually higher than it looks.
  • Standardize on one serialization format (Avro or Protobuf) across the platform to keep tooling and governance consistent.
Last updated June 1, 2026
Was this helpful?