Victor-Kipruto-Rop/streaming-pipeline
Victor-Kipruto-Rop/streaming-pipeline has 42 GitHub stars and 0 forks. Star changes are not measured yet. Last checked 2026-11-14 02:46 UTC. Last push 2026-07-01.
측정된 스타 증가
- in 24h
- 기록 수집 중
- in 7 days
- 기록 수집 중
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
소개
Real-time data streaming pipeline built with modern data engineering tools for scalable ingestion, processing, transformation, and analytics of continuous data streams.
데이터README.md
OriginalReal-Time Streaming Pipeline
A production-ready event streaming pipeline with IoT, clickstream, and M-Pesa ingestion, Avro schema enforcement, Apache Flink processing, and resilient sink architecture.
Overview
This repository demonstrates a complete streaming architecture with:
- Avro-encoded producers for IoT, clickstream, and M-Pesa events
- Schema Registry compatibility and evolution testing
- Kafka topic catalog with dev/prod replication settings
- PyFlink aggregation and anomaly detection
- PostgreSQL and Redis sinks for persistent and real-time data
- Dead-letter queue consumer for failed event handling
- GitHub Actions CI for linting, type checking, and tests
Architecture
flowchart LR
A[IoT Producer] --> B[Kafka: iot.sensor.events]
C[Clickstream Producer] --> D[Kafka: clickstream.events]
E[M-Pesa Producer] --> F[Kafka: mpesa.transactions]
B --> G[Flink: Aggregation + Anomaly Detection]
D --> G
F --> G
G --> H[Kafka: processed.aggregates]
G --> I[Kafka: alerts.anomalies]
G --> J[PostgreSQL]
G --> K[Redis]
L[Failed events] --> M[Kafka: dlq.failed.events] --> N[DLQ Consumer]
O[Prometheus] <-- scrapes all services
P[Grafana] --> O
Q[Schema Registry] <-- used by all producers and consumers
Key Engineering Decisions
- Flink over Spark Streaming: true stateful per-key processing with low latency and no micro-batching overhead.
- Avro + Schema Registry: strict schema enforcement, compact binary payloads, and safe schema evolution.
- Redis for real-time state: Redis is used for sub-second dashboards while PostgreSQL stores durable historical aggregates.
- Z-score threshold rationale: the default
3.0keeps false positives low for normally-distributed metrics and remains configurable. - DLQ isolation: failed events are routed to a dedicated dead-letter topic and consumer, preventing pipeline blockage.
What’s Included
requirements.txtandrequirements-dev.txtpyproject.tomlwithmypy,black, andpytestsettingsconfig/topics.yamlfor Kafka topic definitionsscripts/create_topics.shfor YAML-driven topic creationconsumers/dlq_consumer.pywith observability and graceful shutdownproducers/mpesa_producer.pywith realistic Kenyan transaction generationschemas/containing Avro v1/v2 and M-Pesa event schemastests/test_schema_evolution.pyfor compatibility testing.github/workflows/ci.ymlfor CI validationCHANGELOG.mdandSECURITY.md
Getting Started
Prerequisites
- Docker and Docker Compose
- Python 3.11+
- Java 11+
Setup
python3 -m venv venv
source venv/bin/activate
pip install -r requirements-dev.txt
cp .env.example .env
Run the stack
make build
make up
bash scripts/create_topics.sh
Run tests
make test
make test-unit
make test-integration
M-Pesa Context
This pipeline includes a dedicated M-Pesa transaction stream to model Kenyan FinTech behavior. It supports:
- realistic Safaricom MSISDN ranges (
2547...,2541...) - business-hours spikes
- P2P, Paybill, Till, withdrawal, and deposit transaction types
- failure reason handling and short retention for sensitive data
Schema Evolution
The schemas/ folder contains versioned Avro definitions. tests/test_schema_evolution.py verifies backward and forward compatibility.
Benchmarks
Run make load-test to reproduce locally.
| Scenario | Events/sec | P99 Latency | Notes |
|---|---|---|---|
| IoT + clickstream | 1000 | < 150 ms | Local Docker deployment |
| M-Pesa burst | 500 | < 200 ms | Business-hours spike profile |
Monitoring
- Grafana dashboards in
monitoring/with M-Pesa throughput, status, and DLQ panels - Prometheus scrapes the DLQ consumer and M-Pesa producer metrics
- DLQ consumer metrics available on port
8002 - M-Pesa producer metrics available on port
8003
Repository Topics
- apache-kafka
- apache-flink
- data-engineering
- stream-processing
- python
- docker
- grafana
- fintech
- mpesa
- kenya
관련 프로젝트 살펴보기
Asabeneh/30-Days-Of-Python
30 Days of Python 프로그래밍 챌린지는 Python 프로그래밍 언어를 30일 동안 배우기 위한 단계별 가이드입니다. 이 챌린지는 100일 이상 걸릴 수 있습니다. 자신의 속도에 맞춰 진행하세요. 다음 동영상도 도움이 될 수 있습니다: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,711 스타grafana/grafana
개방적이고 조합 가능한 옵저버빌리티 및 데이터 시각화 플랫폼입니다. Prometheus, Loki, Elasticsearch, InfluxDB, Postgres 등 여러 소스의 메트릭, 로그, 트레이스를 시각화합니다.
77,894 스타redis/redis
실시간 데이터 기반 애플리케이션을 구축하는 개발자에게 Redis는 가장 선호되고, 가장 빠르며, 기능이 가장 풍부한 캐시, 데이터 구조 서버이자 문서 및 벡터 쿼리 엔진입니다.
77,490 스타apache/superset
Apache Superset는 데이터 시각화 및 데이터 탐색 플랫폼입니다.
75,522 스타