{"id":26671967,"url":"https://github.com/adudko/streaming-data-loader","last_synced_at":"2026-04-28T20:35:17.530Z","repository":{"id":283929434,"uuid":"953239530","full_name":"aDudko/streaming-data-loader","owner":"aDudko","description":"Tool for efficient loading and processing of streaming data from Kafka to Elasticsearch","archived":false,"fork":false,"pushed_at":"2025-03-23T04:43:05.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T05:24:17.526Z","etag":null,"topics":["asynchronous","bulk-api","docker-compose-infra","elasticsearch","kafka-consumer","streaming-data-processing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aDudko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-22T22:13:15.000Z","updated_at":"2025-03-23T04:43:08.000Z","dependencies_parsed_at":"2025-03-23T05:34:21.966Z","dependency_job_id":null,"html_url":"https://github.com/aDudko/streaming-data-loader","commit_stats":null,"previous_names":["adudko/streaming-data-loader"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aDudko%2Fstreaming-data-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aDudko%2Fstreaming-data-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aDudko%2Fstreaming-data-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aDudko%2Fstreaming-data-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aDudko","download_url":"https://codeload.github.com/aDudko/streaming-data-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245566471,"owners_count":20636469,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asynchronous","bulk-api","docker-compose-infra","elasticsearch","kafka-consumer","streaming-data-processing"],"created_at":"2025-03-26T00:35:50.891Z","updated_at":"2026-04-28T20:35:17.525Z","avatar_url":"https://github.com/aDudko.png","language":"Python","readme":"# Streaming Data Loader\n\n[![Python](https://img.shields.io/badge/Python-3.12-blue.svg)](https://www.python.org)\n[![Kafka](https://img.shields.io/badge/Kafka-Streaming-red)](https://kafka.apache.org/)\n[![Elasticsearch](https://img.shields.io/badge/Elasticsearch-Search-yellow)](https://www.elastic.co/elasticsearch/)\n[![Prometheus](https://img.shields.io/badge/Monitoring-Prometheus-orange)](https://prometheus.io/)\n[![Grafana](https://img.shields.io/badge/Dashboards-Grafana-brightgreen)](https://grafana.com/)\n[![AsyncIO](https://img.shields.io/badge/Async-Enabled-lightgrey)](https://docs.python.org/3/library/asyncio.html)\n[![CI](https://img.shields.io/badge/Tests-Pytest-green)](https://docs.pytest.org)\n[![Docker](https://img.shields.io/badge/Docker-Ready-blue)](https://www.docker.com/)\n[![Kubernetes](https://img.shields.io/badge/K8s-Supported-blueviolet)](https://kubernetes.io/)\n[![License](https://img.shields.io/badge/License-MIT-lightgrey)](LICENSE)\n\n---\n\n## Overview\n\n**Streaming Data Loader** is a high-performance, async-powered microservice for processing data streams from **Kafka**\nand bulk-loading them into **Elasticsearch**. It combines modern Python tooling with observability best practices to\nprovide **reliable, scalable, and debuggable data pipelines**.\n\nIt’s fast, resilient, and production-ready — ideal for those who need lightweight alternatives to complex ETL systems.\n\n---\n\n## Key Features\n\n- **Asynchronous processing** with `asyncio`, `aiokafka`, and `aiohttp`\n- **Batch insertions** for throughput efficiency\n- **Retry \u0026 fault-tolerant** logic for Kafka and Elasticsearch\n- **Configurable** via `.env` and `pydantic-settings`\n- **Docker \u0026 Kubernetes ready**\n- **Prometheus + Grafana** monitoring included\n- **Tested** with `pytest`, including integration scenarios\n\n---\n\n## Quick Start\n\n### 🐳 Docker Compose\n\n```bash\ndocker-compose up --build\n```\n\n- http://localhost:9090 → Prometheus\n- http://localhost:3000 → Grafana (admin / admin)\n- http://localhost:8080 → Kafka UI\n\n### ☸️ Kubernetes\n\n#### Step 1 — Deploy\n\n```bash\n./k8s-deploy.sh\n```\n\n#### Step 2 — Cleanup\n\n```bash\n./k8s-clean.sh\n```\n\n---\n\n## Architecture\n\nThis project uses **Hexagonal Architecture** (Ports and Adapters), ensuring modularity, extensibility, and clean separation of concerns.\n\n```text\nKafka -→ KafkaConsumerService -→ EventService -→ ElasticsearchClientService -→ Elasticsearch\n                         │                ↓\n                         └-→ Metrics + Logging (Prometheus + JSON logs)\n```\n\n### Layers\n\n- **Input Ports**: Kafka Consumer (aiokafka), deserialization, batching\n- **Application Core**: Event transformation, validation, retry logic\n- **Output Ports**: Async Elasticsearch client, bulk insert, failure handling\n- **Infrastructure**: Docker, Kubernetes, logging, metrics, monitoring\n\n---\n\n## 🔍 Why Choose This Over Logstash, Flume, etc.?\n\n- ✅ **True async** data pipeline — lower latency, better throughput\n- ✅ **No heavyweight config DSL** — Python code, `pyproject.toml`, `.env`\n- ✅ **Built-in retries \u0026 fault handling** — robust out of the box\n- ✅ **JSON logging** and metric labeling for full observability\n- ✅ **Open-source \u0026 customizable** — perfect for modern data teams\n\n---\n\n## Observability\n\nPrometheus scrapes metrics on `/metrics` (port `8000`). Dashboards are automatically provisioned in Grafana.\n\n| Metric                              | Description                        |\n|-------------------------------------|------------------------------------|\n| `messages_processed_total`          | Total number of processed messages |\n| `errors_total`                      | Total errors during processing     |\n| `consume_duration_seconds`          | Time spent reading from Kafka      |\n| `response_duration_seconds`         | Time to insert into Elasticsearch  |\n| `transform_duration_seconds`        | Time spent transforming messages   |\n| `batch_processing_duration_seconds` | Full batch processing time         |\n\n---\n\n## Testing\n\n```bash\npytest -v\n```\n\nIncludes:\n\n- ✅ Unit tests\n- ✅ Integration tests (Kafka → ES)\n- ✅ Metrics verification\n- ✅ Config validation\n\n---\n\n## Technologies\n\n- `Python 3.12` + `asyncio`\n- `Kafka + aiokafka`\n- `Elasticsearch` `Bulk API`\n- `Pydantic` `dotenv` `poetry`\n- `Prometheus` `Grafana`\n- `Docker` `docker-compose`\n- `Kubernetes-ready`\n- JSON logging (`python-json-logger`)\n\n---\n\n## Project Structure\n\n```text\nstreaming-data-loader/\n├── configs/                     # Prometheus / Grafana\n├── src/                         # Main source code\n│   ├── domain/\n│   ├── ports/\n│   ├── services/                # Event processing logic\n│   ├── config.py                # Settings \u0026 env config\n│   ├── logger.py                # JSON logger setup\n│   └── metrics.py               # Prometheus metrics\n├── tests/                       # Unit \u0026 integration tests\n├── k8s/                         # Kubernetes manifests\n├── docker-compose.yml\n├── Dockerfile\n├── deploy.sh / clean.sh\n└── pyproject.toml\n```\n\n---\n\n## If you find this useful...\n\n...give it a star, fork it, or mention it in your next data project!\n\n## Author\n\n**Anatoly Dudko**  \n[GitHub @aDudko](https://github.com/aDudko) • [LinkedIn](https://www.linkedin.com/in/dudko-anatol/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadudko%2Fstreaming-data-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadudko%2Fstreaming-data-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadudko%2Fstreaming-data-loader/lists"}