How mohidmakhdoomi/datapipe works
1. Repository purpose
- This repo is an infrastructure-heavy data platform, not an application codebase.
- The implemented core is a Kubernetes-hosted CDC ingestion pipeline that moves changes from PostgreSQL into Kafka and archives them to S3.
- The broader repo also contains scaffolding for the next Lambda-architecture layers: batch analytics, realtime speed layer, and orchestration/monitoring.
2. Primary runtime boundary
- The main runtime is a local kind Kubernetes cluster running on Docker Desktop.
- Most behavior is expressed as Kubernetes manifests, Helm/value files, and shell scripts rather than long-lived application services.
- The repo is designed around reproducible local deployment under a strict memory budget.
3. Source system boundary
- The source of truth is a PostgreSQL database deployed inside the cluster.
- It represents the transactional OLTP layer for e-commerce entities such as users, products, orders, and order_items.
- CDC is enabled through PostgreSQL logical replication/WAL, so database changes drive the rest of the pipeline.
4. Streaming core
- The central streaming layer is a 3-broker Kafka cluster in KRaft mode.
- Kafka is the durable event backbone between source capture and archival.
- Topics are provisioned explicitly, and the deployment includes resource-constrained sizing to keep the entire stack within 6 GiB RAM.
5. CDC ingestion path
- Debezium Kafka Connect source connectors read PostgreSQL WAL changes and publish Avro-encoded change events into Kafka.
- Connector configs are stored as JSON files under 1-data-ingestion-pipeline/connectors/.
- This is the main real-time ingestion path from relational DB mutations to event streams.
6. Schema management boundary
- Confluent Schema Registry sits between producers/consumers as the schema contract layer.
- Its role is to validate and evolve Avro schemas so CDC events can change without breaking downstream consumers.
- This is an architectural control point, not just a dependency.
7. Archive / sink path
- A second Kafka Connect S3 Sink connector consumes Kafka topics and writes immutable data to AWS S3.
- Output is stored as Parquet, partitioned by time (year/month/day/hour) for analytical access patterns.
- S3 is the terminal sink for the core pipeline and the handoff point to later batch/lakehouse layers.
8. Kubernetes infrastructure and isolation
- The repo explicitly defines namespaces, service accounts, RBAC, network policies, storage classes, and PVCs.
- This means the architecture is not just “services running together”; it has a deliberate security and storage boundary model.
- The manifests in 01-*, 02-*, 03-*, 04-*, and task*.yaml are the concrete deployment substrate.
9. Automation and validation flow
- deploy-data-ingestion-pipeline.sh is the main orchestration script that builds/deploys the cluster and applies components in order.
- There are multiple validation scripts for health, connectivity, CDC correctness, performance, persistence, and S3 archival.
- data-generator.py is used as synthetic workload to exercise the end-to-end path and measure throughput.
10. Operational artifacts
- The logs/ directory captures deployment logs, resource monitoring output, validation reports, and performance results.
- These logs are part of the repo’s operational story: they document that the pipeline was exercised and what resource envelope it consumed.
- resource-monitor.sh and related outputs show that observability is treated as a first-class concern for this local platform.
11. Batch analytics layer scaffolding
- 2-batch-analytics-layer/ is a separate subsystem, currently more scaffold than runtime.
- It contains Spark Operator deployment artifacts, S3 connectivity checks, Snowflake setup, Iceberg catalog setup, and e-commerce table jobs.
- This layer is intended to consume the archived S3 data produced by the ingestion pipeline.
12. Developer and environment tooling
- .devcontainer/ and utils-dev/ support reproducible development and ad hoc data inspection.
- The devcontainer packages the environment needed to work on the pipeline locally, while utilities include S3 Parquet query/read scripts and resource conversion helpers.
- These tools are ancillary; they support deployment and analysis but are not part of the production data path.
13. Design/specification boundary
- .kiro/specs/ contains requirements, design, and task documents for each major capability area.
- This repository uses docs-as-spec for architecture traceability: ingestion, batch analytics, realtime speed layer, and monitoring each have their own spec set.
- That makes the repo useful for diagramming both the implemented state and planned architecture.
14. Overall data flow summary
- The implemented flow is: PostgreSQL transaction changes → Debezium CDC on Kafka Connect → Kafka topics with schema enforcement → S3 Sink connector → Parquet files in AWS S3.
- Kubernetes provides the execution and isolation boundary for all of it.
- Everything else in the repo supports deployment, validation, security, or future extension of that flow.
Main entry points: kind-config.yaml kind cluster · task2-deploy-spark-operator.sh Spark operator · users-debezium-connector.json Debezium sources · users-s3-sink-connector.json S3 sink connectors
Components 20
Platform runtime
Local Kubernetes-based execution and isolation boundary for the stack.
- kind cluster · Local Kubernetes cluster on Docker Desktop that hosts the pipeline.
1-data-ingestion-pipeline/kind-config.yaml
CDC ingestion
Implemented PostgreSQL-to-Kafka-to-S3 data pipeline.
- PostgreSQL · Transactional source database with logical replication/WAL for CDC.
1-data-ingestion-pipeline/task4-postgresql-statefulset.yaml - Kafka KRaft · Three-broker Kafka cluster that carries CDC events and archive topics.
1-data-ingestion-pipeline/task5-kafka-kraft-3brokers.yaml - Schema Registry · Validates and evolves Avro schemas for CDC events and consumers.
1-data-ingestion-pipeline/task6-schema-registry.yaml - Kafka Connect · Executes Debezium source connectors and S3 sink connectors.
1-data-ingestion-pipeline/task7-kafka-connect-deployment.yaml - Debezium sources · Per-table source connectors that read PostgreSQL WAL and publish change events.
1-data-ingestion-pipeline/connectors/users-debezium-connector.json - S3 sink connectors · Per-table sink connectors that write Kafka data to S3 as Parquet partitions.
1-data-ingestion-pipeline/connectors/users-s3-sink-connector.json - AWS S3 · Terminal sink for archived change data and handoff for downstream analytics.
2-batch-analytics-layer/task3-s3-connectivity-test.yaml - Data generator · Synthetic e-commerce workload used to exercise the CDC path.
1-data-ingestion-pipeline/data-generator.py
Batch analytics
Scaffold for downstream Spark/Iceberg/Snowflake analytics on archived data.
- Batch cluster · Separate local cluster scaffold for downstream batch analytics.
2-batch-analytics-layer/batch-kind-config.yaml - Spark operator · Spark deployment substrate for batch jobs and notebooks.
2-batch-analytics-layer/task2-deploy-spark-operator.sh - Iceberg catalog · Catalog setup for lakehouse-style tables over archived data.
2-batch-analytics-layer/task5-iceberg-catalog-config.yaml - Snowflake setup · Scaffolding for warehouse connectivity and validation jobs.
2-batch-analytics-layer/task4-setup-snowflake.sh
Ops and specs
Deployment automation, validation, monitoring, and design documents.
- Deploy script · Primary automation for cluster bring-up and component deployment.
1-data-ingestion-pipeline/deploy-data-ingestion-pipeline.sh - Validation suite · Health, connectivity, CDC, performance, persistence, and archival checks.
1-data-ingestion-pipeline/task8-validation-runner.sh - Resource monitor · Captures cluster resource usage and operational logs for the constrained stack.
resource-monitor.sh - Ingestion spec · Requirements, design, and tasks for the CDC ingestion pipeline.
.kiro/specs/data-ingestion-pipeline/design.md - Batch spec · Requirements, design, and tasks for the analytics layer.
.kiro/specs/batch-analytics-layer/design.md - Speed spec · Planned realtime speed-layer architecture documents.
.kiro/specs/realtime-analytics-speed-layer/design.md - Monitoring spec · Orchestration and monitoring architecture documents.
.kiro/specs/orchestration-monitoring/design.md
Connections 25
- Deploy script → kind cluster: builds/applies · Coordinates cluster bring-up and manifest application.
- kind cluster → PostgreSQL: hosts · Runs the source database inside Kubernetes.
- kind cluster → Kafka KRaft: hosts · Runs the Kafka backbone in-cluster.
- kind cluster → Schema Registry: hosts · Runs schema contract service alongside the streaming stack.
- kind cluster → Kafka Connect: hosts · Runs connector runtime in the cluster.
- PostgreSQL → Debezium sources: CDC source · Logical replication/WAL feeds Debezium capture.
- Debezium sources → Kafka KRaft: publish · Writes Avro CDC events into Kafka topics.
- Schema Registry → Debezium sources: schema checks · Provides schema contract validation for event payloads.
- Schema Registry → S3 sink connectors: schema checks · Provides schema contract validation for sink-side serialization.
- Kafka Connect → Debezium sources: runs · Executes the source connectors.
- Kafka Connect → S3 sink connectors: runs · Executes the archive sink connectors.
- Kafka KRaft → S3 sink connectors: consume · Sink connectors read topic data for archival.
- S3 sink connectors → AWS S3: archive · Writes partitioned Parquet files to S3.
- Data generator → PostgreSQL: loads · Creates synthetic OLTP activity to drive CDC.
- Validation suite → Debezium sources: verifies · Checks CDC path behavior and correctness.
- Validation suite → AWS S3: verifies · Confirms archival output and persistence.
- Resource monitor → kind cluster: measures · Captures resource usage for the constrained platform.
- Ingestion spec → Deploy script: guides · Documents implementation and deployment intent.
- Batch cluster → Spark operator: hosts · Runs Spark as batch execution substrate.
- Spark operator → Iceberg catalog: uses · Jobs rely on catalog configuration for table access.
- Spark operator → Snowflake setup: integrates · Supports warehouse connectivity and validation.
- AWS S3 → Spark operator: consumed by · Archived Parquet data is the input for batch analytics.
- Batch spec → Spark operator: guides · Documents batch-layer design and tasks.
- Speed spec → AWS S3: plans downstream · Specifies future realtime architecture around the data platform.
- Monitoring spec → Resource monitor: guides · Documents monitoring and operational boundaries.