# ghun06/dremio-nessie-kafka-connect architecture

> Architecture diagram of the GitHub repository ghun06/dremio-nessie-kafka-connect, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ghun06/dremio-nessie-kafka-connect
- Repository: https://github.com/ghun06/dremio-nessie-kafka-connect

## Overview

##### Project Type and Purpose
- This project is a containerized environment designed to test and demonstrate Kafka Connect's integration with Iceberg tables through a Docker Compose setup.
- Its primary purpose is to simulate stream processing by ingesting data into Kafka (using sample data from TransactionsData.json), routing data via Kafka Connect (with specific connector configurations from iceberg-connector-config.properties and kafka-connect.properties), and eventually storing the data in Iceberg tables managed via a Nessie catalog. Additionally, Dremio is used as a data lakehouse platform for querying data stored in object storage (Minio).

##### File Structure
- The file tree includes configuration files (e.g., connector config, logging config, and Kafka Connect properties) and a Dockerfile along with docker-compose.yml which defines the container orchestration.
- The presence of the iceberg-kafka-connect-runtime directory (with a manifest), connect-log4j.properties, and other settings (such as iceberg-connector-config.properties) indicate a focus on a Kafka integration test harness.
- A sample data file (TransactionsData.json) demonstrates how records are sent to the Kafka topic.
- The Dockerfile and docker-compose.yml underscore the container-first architecture tying together several services (Dremio, Nessie, Minio, Kafka, Zookeeper, Kafka REST Proxy, and Kafka Connect).

a. Main Components to Include:
- Docker Compose Orchestrator: Central container that sets up the environment.
- Kafka Ecosystem:
- Kafka: The message broker receiving sample streaming data.
- Zookeeper: Required for Kafka’s cluster coordination.
- Kafka REST Proxy: Provides REST API access for data ingestion.
- Kafka Connect:
- Uses configurations from iceberg-connector-config.properties and kafka-connect.properties.
- Responsible for streaming data from Kafka topics (e.g., “transactions”) to the target system.
- Iceberg Connector Runtime: Provided in the iceberg-kafka-connect-runtime directory.
- Data Storage & Catalog:
- Nessie: Serves as the Iceberg catalog.
- Minio: Object storage holding Iceberg table files.
- Query and Visualization:
- Dremio: Facilitates querying of the stored data after it’s written.

b. Relationships and Data Flow:
- Data flows from an external source or via REST (using TransactionsData.json) to the Kafka cluster (broker and REST Proxy).
- Kafka passively feeds the “transactions” topic.
- Kafka Connect (with its connector configurations and logging settings) consumes from the topic and processes data.
- Processed data is dynamically written into target Iceberg tables managed by Nessie, with files stored in Minio.
- Dremio is configured to query these Iceberg tables through NOTE: connections configured via Nessie.
- Each Docker service is defined and connected via network definitions in docker-compose.yml, ensuring proper inter-service communication.

##### Architectural Patterns & Key Design Principles
- Containerization: Use of Docker (Dockerfile, docker-compose.yml) to ensure an isolated and reproducible environment.
- Modularity: Clear separation between the ingest (Kafka, Kafka Connect), storage (Minio, Nessie), and query (Dremio) layers.
- Declarative Configuration: Externalized settings (properties files) allow easy reconfiguration and cache breaking (as mentioned with Dockerfile echo statement).
- Dynamic Data Routing: The connector’s design supports dynamic table creation based on the “table” field value within the stream, an important architectural note.

##### Specific Elements to Highlight
- “dynamic tables” creation feature by highlighting that records from “transactions” topic are routed based on their "table" field.

## Diagram (Mermaid)

```mermaid
flowchart TD
    EXTERNAL["TransactionsData.json"]:::external
    EXTERNAL -->|"ingests"| REST["Kafka REST Proxy"]:::message

    REST -->|"forwards"| KAFKA["Kafka Broker"]:::message
    KAFKA -->|"consumedBy"| CONNECT["Kafka Connect & Iceberg Connector"]:::stream
    KAFKA ---|"coordinates"| ZOOKEEPER["Zookeeper"]:::message

    subgraph "Kafka Connect Configurations"
        ICEBERG_CFG["Iceberg Connector Config"]:::config
        CONNECT_PROPS["Kafka Connect Properties"]:::config
        LOG_CONFIG["Connect Logging Config"]:::config
        ICEBERG_RUNTIME["Iceberg Connector Runtime"]:::config
    end

    ICEBERG_CFG --> CONNECT
    CONNECT_PROPS --> CONNECT
    LOG_CONFIG --> CONNECT
    ICEBERG_RUNTIME --> CONNECT

    CONNECT -->|"writesTo"| NESSIE["Nessie Catalog"]:::storage
    CONNECT -->|"storesIn"| MINIO["Minio Object Storage"]:::storage
    NESSIE -->|"queriedBy"| DREMIO["Dremio Query Platform"]:::query
    MINIO -->|"queriedBy"| DREMIO

    DOCKER["Docker Compose Orchestrator"]:::orchestrator
    DOCKER --- EXTERNAL
    DOCKER --- REST
    DOCKER --- KAFKA
    DOCKER --- ZOOKEEPER
    DOCKER --- CONNECT
    DOCKER --- NESSIE
    DOCKER --- MINIO
    DOCKER --- DREMIO

    click DOCKER "https://github.com/ghun06/dremio-nessie-kafka-connect/blob/main/docker-compose.yml"
    click DOCKER "https://github.com/ghun06/dremio-nessie-kafka-connect/tree/main/dockerfile"
    click ICEBERG_CFG "https://github.com/ghun06/dremio-nessie-kafka-connect/blob/main/iceberg-connector-config.properties"
    click CONNECT_PROPS "https://github.com/ghun06/dremio-nessie-kafka-connect/blob/main/kafka-connect.properties"
    click LOG_CONFIG "https://github.com/ghun06/dremio-nessie-kafka-connect/blob/main/connect-log4j.properties"
    click ICEBERG_RUNTIME "https://github.com/ghun06/dremio-nessie-kafka-connect/blob/main/iceberg-kafka-connect-runtime-0.6.16"
    click EXTERNAL "https://github.com/ghun06/dremio-nessie-kafka-connect/blob/main/TransactionsData.json"

    classDef orchestrator fill:#AED6F1,stroke:#1F618D,stroke-width:2px
    classDef message fill:#F9E79F,stroke:#B7950B,stroke-width:2px
    classDef stream fill:#D5F5E3,stroke:#27AE60,stroke-width:2px
    classDef storage fill:#FADBD8,stroke:#C0392B,stroke-width:2px
    classDef query fill:#E8DAEF,stroke:#8E44AD,stroke-width:2px
    classDef external fill:#FDEBD0,stroke:#D35400,stroke-width:2px
    classDef config fill:#D6EAF8,stroke:#2471A3,stroke-width:2px
```
